Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1237)

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 357653003: Mark the single autofilled field when the relevant section is autofilled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 370a8f02e4aeced484a49090925c117b1ca8e2c3..8fb959f7a00ee9351db2d1e5eaacf7425ba8ca23 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -558,6 +558,7 @@ void AutofillManager::FillOrPreviewForm(
// If the relevant section is auto-filled, we should fill |field| but not the
// rest of the form.
if (SectionIsAutofilled(*form_structure, form, autofill_field->section())) {
+ size_t i = 0;
for (std::vector<FormFieldData>::iterator iter = result.fields.begin();
iter != result.fields.end(); ++iter) {
if ((*iter) == field) {
@@ -569,11 +570,17 @@ void AutofillManager::FillOrPreviewForm(
// user edits an autofilled field (for metrics).
autofill_field->is_autofilled = true;
+ // Mark the field as autofilled when a non-empty value is assigned to
+ // it. This allows the renderer to distinguish autofilled fields from
+ // fields with non-empty values, such as select-one fields.
+ result.fields[i].is_autofilled = true;
Ilya Sherman 2014/06/25 20:08:29 Can you use (*iter) here, rather than adding an ex
+
if (!is_credit_card && !value.empty())
client_->DidFillOrPreviewField(value, profile_full_name);
}
break;
}
+ ++i;
}
driver_->SendFormDataToRenderer(query_id, action, result);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698