diff options
author | bondd <bondd@chromium.org> | 2015-08-20 22:41:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-21 05:42:25 +0000 |
commit | 2bd10411624467d8b53e2879719c20816017fb27 (patch) | |
tree | 14be376ec029a24793e44962bc560c4bda619993 | |
parent | 978e9cf8a0924936aae1a906bb845aca40a74e1d (diff) | |
download | chromium_src-2bd10411624467d8b53e2879719c20816017fb27.zip chromium_src-2bd10411624467d8b53e2879719c20816017fb27.tar.gz chromium_src-2bd10411624467d8b53e2879719c20816017fb27.tar.bz2 |
iOS Autofill: Copy attributes for select-one elements to fix UMA stats.
Port one line form_autofill_util.cc change from https://crrev.com/1245623003 to iOS. This fixes wrong metrics for select fields in FormStructure::LogQualityMetrics.
Add a comment for AutofillManager::OnWillSubmitForm() as requested for downstream iOS CL here: https://chromereviews.googleplex.com/247607013/#msg11
BUG=
Review URL: https://codereview.chromium.org/1307733003
Cr-Commit-Position: refs/heads/master@{#344686}
-rw-r--r-- | components/autofill/core/browser/autofill_manager.h | 5 | ||||
-rw-r--r-- | components/autofill/ios/browser/resources/autofill_controller.js | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h index e97adf7..50db8e2 100644 --- a/components/autofill/core/browser/autofill_manager.h +++ b/components/autofill/core/browser/autofill_manager.h @@ -169,6 +169,11 @@ class AutofillManager : public AutofillDownloadManager::Observer, void OnFormsSeen(const std::vector<FormData>& forms, const base::TimeTicks& timestamp); + // IMPORTANT: On iOS, this method is called when the form is submitted, + // immediately before OnFormSubmitted() is called. Do not assume that + // OnWillSubmitForm() will run before the form submits. + // TODO(mathp): Revisit this and use a single method to track form submission. + // // Processes the about-to-be-submitted |form|, uploading the possible field // types for the submitted fields to the crowdsourcing server. Returns false // if this form is not relevant for Autofill. diff --git a/components/autofill/ios/browser/resources/autofill_controller.js b/components/autofill/ios/browser/resources/autofill_controller.js index 72ee604..3ddd035 100644 --- a/components/autofill/ios/browser/resources/autofill_controller.js +++ b/components/autofill/ios/browser/resources/autofill_controller.js @@ -1620,7 +1620,8 @@ __gCrWeb.autofill.webFormControlElementToFormField = function( } if (__gCrWeb.autofill.isAutofillableInputElement(element) || - __gCrWeb.autofill.isTextAreaElement(element)) { + __gCrWeb.autofill.isTextAreaElement(element) || + __gCrWeb.autofill.isSelectElement(element)) { field['is_autofilled'] = element.isAutofilled; field['should_autocomplete'] = __gCrWeb.common.autoComplete(element); field['is_focusable'] = !element.disabled && !element.readOnly && |