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

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: Created 6 years, 7 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..4d0330badc81f9db7e104a2e5914225fde57255e 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -581,9 +581,14 @@ void PreviewFormField(const FormFieldData& data,
input_element->setSuggestedValue(
data.value.substr(0, input_element->maxLength()));
input_element->setAutofilled(true);
- } else if (IsTextAreaElement(*field) || IsSelectElement(*field)) {
+ } else if (IsTextAreaElement(*field)) {
field->setSuggestedValue(data.value);
field->setAutofilled(true);
+ } else {
+ DCHECK(IsSelectElement(*field));
+ field->setSuggestedValue(data.value);
Ilya Sherman 2014/06/02 23:51:00 We should only set the suggested value if the fiel
+ if (data.is_autofilled)
+ field->setAutofilled(true);
}
if (is_initiating_node &&

Powered by Google App Engine
This is Rietveld 408576698