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

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

Issue 2640783002: [Password Generation] Send id attribute to server for HTML based form classifier (Closed)
Patch Set: Fixed failed test Created 3 years, 11 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 8d690c2446a2a26163f46760c728104f15249f37..821c3e6cdbfb5432db9091e34ef9273d40af4a34 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -1366,6 +1366,7 @@ void WebFormControlElementToFormField(
DCHECK(field);
DCHECK(!element.isNull());
CR_DEFINE_STATIC_LOCAL(WebString, kAutocomplete, ("autocomplete"));
+ CR_DEFINE_STATIC_LOCAL(WebString, kId, ("id"));
CR_DEFINE_STATIC_LOCAL(WebString, kRole, ("role"));
CR_DEFINE_STATIC_LOCAL(WebString, kPlaceholder, ("placeholder"));
CR_DEFINE_STATIC_LOCAL(WebString, kClass, ("class"));
@@ -1374,6 +1375,9 @@ void WebFormControlElementToFormField(
// labels for all form control elements are scraped from the DOM and set in
// WebFormElementToFormData.
field->name = element.nameForAutofill();
+ base::string16 id = element.getAttribute(kId);
+ if (id != field->name)
sebsg 2017/01/18 19:22:49 Can you also just make a quick note or refer to HT
kolos1 2017/01/19 11:09:16 Done. Also removed the comment about the label. A
+ field->id = id;
field->form_control_type = element.formControlType().utf8();
field->autocomplete_attribute = element.getAttribute(kAutocomplete).utf8();
if (field->autocomplete_attribute.size() > kMaxDataLength) {

Powered by Google App Engine
This is Rietveld 408576698