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); |