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

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

Issue 1671753004: [Autofill] Fill fields that have an autocomplete attributes even if not in a form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 cb250901cebf9981ecdf844b0dbaade93acb50b4..070e727d6f573d9e8291e4ace93721a6cd8c9af7 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -1527,7 +1527,23 @@ bool UnownedCheckoutFormElementsAndFieldSetsToFormData(
}
}
- return false;
+ // Since it's not a checkout flow, only add fields that have an autocomplete
Mathieu 2016/02/05 18:39:06 *a non-"off" autocomplete attribute
sebsg 2016/02/05 20:08:00 Done.
+ // attribute to the formless autofill.
+ std::vector<WebFormControlElement> elements_with_autocomplete;
+ for (const WebFormControlElement& element : control_elements) {
+ blink::WebString autocomplete = element.getAttribute("autocomplete");
+ if (autocomplete.utf8() != "" && autocomplete.utf8() != "off")
Mathieu 2016/02/05 18:39:06 Other methods seem to define statics like so: CR_
Mathieu 2016/02/05 18:39:06 if (autocomplete.length() && ...
sebsg 2016/02/05 20:08:00 Done.
sebsg 2016/02/05 20:08:00 Done.
+ elements_with_autocomplete.push_back(element);
+ }
+
+ if (elements_with_autocomplete.empty())
+ return false;
+
+ form->is_syntehtic_non_checkout_form = true;
Mathieu 2016/02/05 18:39:06 Could we do only with a |non_checkout| attribute i
sebsg 2016/02/05 20:08:00 Done.
+
+ return UnownedFormElementsAndFieldSetsToFormData(
+ fieldsets, elements_with_autocomplete, element, document, extract_mask,
+ form, field);
}
bool UnownedPasswordFormElementsAndFieldSetsToFormData(

Powered by Google App Engine
This is Rietveld 408576698