summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 15:33:04 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 15:33:04 +0000
commit71dc1ea1f2c374b56e674df3ee9c743bd2c714a0 (patch)
tree731fc22721a2ec361a0a2f6aea32846fbda77e4c /components
parent2210a40e252eeec9e299fa6f65e9d5b68929a09a (diff)
downloadchromium_src-71dc1ea1f2c374b56e674df3ee9c743bd2c714a0.zip
chromium_src-71dc1ea1f2c374b56e674df3ee9c743bd2c714a0.tar.gz
chromium_src-71dc1ea1f2c374b56e674df3ee9c743bd2c714a0.tar.bz2
Android: allows logging of autofield values, part 2.
Filters out non-empty fields since they won't be autofilled. BUG=b/13118743 Review URL: https://codereview.chromium.org/179413003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r--components/autofill/core/browser/autofill_manager.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 90f41da..0934871 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -535,13 +535,24 @@ void AutofillManager::OnFillAutofillFormData(int query_id,
}
base::string16 value = data_model->GetInfoForVariant(
cached_field->Type(), use_variant, app_locale_);
+
+ // Must match ForEachMatchingFormField() in form_autofill_util.cc.
+ // Only notify autofilling of empty fields and the field that initiated
+ // the filling (note that "select-one" controls may not be empty but will
+ // still be autofilled).
+ bool should_notify =
+ !is_credit_card &&
+ !value.empty() &&
+ (result.fields[i] == field ||
+ result.fields[i].form_control_type == "select-one" ||
+ result.fields[i].value.empty());
AutofillField::FillFormField(*cached_field, value, app_locale_,
&result.fields[i]);
// Mark the cached field as autofilled, so that we can detect when a user
// edits an autofilled field (for metrics).
form_structure->field(i)->is_autofilled = true;
- if (!is_credit_card && !value.empty())
+ if (should_notify)
manager_delegate_->DidFillOrPreviewField(value, profile_full_name);
}
}