Index: components/autofill/content/renderer/autofill_agent.cc |
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc |
index ab9bfae2cc956d59d0b93a3ca2b35b0ef60aa9d9..bab2b4d82a0f060e76402831f01677e38662e19a 100644 |
--- a/components/autofill/content/renderer/autofill_agent.cc |
+++ b/components/autofill/content/renderer/autofill_agent.cc |
@@ -488,8 +488,10 @@ void AutofillAgent::OnClearPreviewedForm() { |
void AutofillAgent::OnFillFieldWithValue(const base::string16& value) { |
WebInputElement* input_element = toWebInputElement(&element_); |
- if (input_element) |
+ if (input_element) { |
FillFieldWithValue(value, input_element); |
+ input_element->setAutofilled(true); |
+ } |
} |
void AutofillAgent::OnPreviewFieldWithValue(const base::string16& value) { |
@@ -674,7 +676,6 @@ void AutofillAgent::FillFieldWithValue(const base::string16& value, |
WebInputElement* node) { |
did_set_node_text_ = true; |
node->setEditingValue(value.substr(0, node->maxLength())); |
- node->setAutofilled(true); |
} |
void AutofillAgent::PreviewFieldWithValue(const base::string16& value, |