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

Unified Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 309063006: Do not autofill element when there is no autofill suggestion from profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update code as per further review comments. 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
Index: components/autofill/content/renderer/form_autofill_util.cc
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index 0762a8c2f42d63453203996698864f515690072f..46852f2fbfba8457562ea1f63a333f8977436389 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -537,6 +537,9 @@ void FillFormField(const FormFieldData& data,
if (data.value.empty())
return;
+ if (!data.is_autofilled)
+ return;
+
field->setAutofilled(true);
WebInputElement* input_element = toWebInputElement(field);
@@ -571,6 +574,9 @@ void PreviewFormField(const FormFieldData& data,
if (data.value.empty())
return;
+ if (!data.is_autofilled)
+ return;
+
// Preview input, textarea and select fields. For input fields, excludes
// checkboxes and radio buttons, as there is no provision for
// setSuggestedCheckedValue in WebInputElement.

Powered by Google App Engine
This is Rietveld 408576698