diff options
| author | Felipe Leme <felipeal@google.com> | 2017-09-18 16:58:08 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-09-18 16:58:08 +0000 |
| commit | 358f7fdff310c52cc5cbdb27ac82f52ddbb0d4bf (patch) | |
| tree | 7b462f5d11a7eb59a4be6af00fa5b3c8731abefe /core/java/android/webkit/WebView.java | |
| parent | af642f5914f3e31fb07c95f41f21d19b42d61347 (diff) | |
| parent | d96b0d1b472f2acb1b6603f3c528be784f8a1a58 (diff) | |
Merge "Minor fixes on WebView.onProvideAutofillVirtualStructure() javadoc." into oc-mr1-dev
am: d96b0d1b47
Change-Id: Ia209d29b9bd71e4fde44cadf8c5c07c5967f6d47
Diffstat (limited to 'core/java/android/webkit/WebView.java')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index f918cadde87c..637b60e2dcb4 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -2723,25 +2723,20 @@ public class WebView extends AbsoluteLayout * {@code IFRAME}, in which case it would be treated the same way as multiple forms described * above, except that the {@link ViewStructure#setWebDomain(String) web domain} of the * {@code FORM} contains the {@code src} attribute from the {@code IFRAME} node. - * <li>If the Android SDK provides a similar View, then should be set with the - * fully-qualified class name of such view. * <li>The W3C autofill field ({@code autocomplete} tag attribute) maps to - * {@link ViewStructure#setAutofillHints(String[])}. - * <li>The {@code type} attribute of {@code INPUT} tags maps to - * {@link ViewStructure#setInputType(int)}. - * <li>The {@code value} attribute of {@code INPUT} tags maps to - * {@link ViewStructure#setText(CharSequence)}. - * <li>If the view is editalbe, the {@link ViewStructure#setAutofillType(int)} and + * {@link ViewStructure#setAutofillHints(String[])}. + * <li>If the view is editable, the {@link ViewStructure#setAutofillType(int)} and * {@link ViewStructure#setAutofillValue(AutofillValue)} must be set. * <li>The {@code placeholder} attribute maps to {@link ViewStructure#setHint(CharSequence)}. * <li>Other HTML attributes can be represented through * {@link ViewStructure#setHtmlInfo(android.view.ViewStructure.HtmlInfo)}. * </ol> * - * <p>It should also call {@code structure.setDataIsSensitive(false)} for fields whose value - * were not dynamically changed (for example, through Javascript). + * <p>If the WebView implementation can determine that the value of a field was set statically + * (for example, not through Javascript), it should also call + * {@code structure.setDataIsSensitive(false)}. * - * <p>Example1: an HTML form with 2 fields for username and password. + * <p>For example, an HTML form with 2 fields for username and password: * * <pre class="prettyprint"> * <input type="text" name="username" id="user" value="Type your username" autocomplete="username" placeholder="Email or username"> @@ -2754,51 +2749,27 @@ public class WebView extends AbsoluteLayout * int index = structure.addChildCount(2); * ViewStructure username = structure.newChild(index); * username.setAutofillId(structure.getAutofillId(), 1); // id 1 - first child - * username.setClassName("input"); - * username.setInputType("android.widget.EditText"); * username.setAutofillHints("username"); * username.setHtmlInfo(username.newHtmlInfoBuilder("input") * .addAttribute("type", "text") * .addAttribute("name", "username") - * .addAttribute("id", "user") * .build()); * username.setHint("Email or username"); * username.setAutofillType(View.AUTOFILL_TYPE_TEXT); * username.setAutofillValue(AutofillValue.forText("Type your username")); - * username.setText("Type your username"); - * // Value of the field is not sensitive because it was not dynamically changed: + * // Value of the field is not sensitive because it was created statically and not changed. * username.setDataIsSensitive(false); * * ViewStructure password = structure.newChild(index + 1); * username.setAutofillId(structure, 2); // id 2 - second child - * password.setInputType("android.widget.EditText"); - * password.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); * password.setAutofillHints("current-password"); * password.setHtmlInfo(password.newHtmlInfoBuilder("input") * .addAttribute("type", "password") * .addAttribute("name", "password") - * .addAttribute("id", "pass") * .build()); * password.setHint("Password"); * password.setAutofillType(View.AUTOFILL_TYPE_TEXT); * </pre> - * - * <p>Example2: an IFRAME tag. - * - * <pre class="prettyprint"> - * <iframe src="https://example.com/login"/> - * </pre> - * - * <p>Would map to: - * - * <pre class="prettyprint"> - * int index = structure.addChildCount(1); - * ViewStructure iframe = structure.newChildFor(index); - * iframe.setAutofillId(structure.getAutofillId(), 1); - * iframe.setHtmlInfo(iframe.newHtmlInfoBuilder("iframe") - * .addAttribute("src", "https://example.com/login") - * .build()); - * </pre> */ @Override public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) { |
