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

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

Issue 2073093002: [Password Generation] Sends CSS classes inside autofill proto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed useless FormStructure recreation in FormStructureTest.EncodeUploadRequest_WithCssClasses Created 4 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 c2e6030da9ade379b15af4af3c67fa7e32bffe4c..69e24c1cfdbfe7e0f77c2cfba02e4b72e43ee3f3 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(const WebFormControlElement& element,
CR_DEFINE_STATIC_LOCAL(WebString, kAutocomplete, ("autocomplete"));
CR_DEFINE_STATIC_LOCAL(WebString, kRole, ("role"));
CR_DEFINE_STATIC_LOCAL(WebString, kPlaceholder, ("placeholder"));
+ CR_DEFINE_STATIC_LOCAL(WebString, kClass, ("class"));
// The label is not officially part of a WebFormControlElement; however, the
// labels for all form control elements are scraped from the DOM and set in
@@ -1384,6 +1385,8 @@ void WebFormControlElementToFormField(const WebFormControlElement& element,
field->role = FormFieldData::ROLE_ATTRIBUTE_PRESENTATION;
field->placeholder = element.getAttribute(kPlaceholder);
+ if (element.hasAttribute(kClass))
+ field->css_classes = element.getAttribute(kClass);
if (!IsAutofillableElement(element))
return;
« no previous file with comments | « chrome/renderer/autofill/form_autofill_browsertest.cc ('k') | components/autofill/core/browser/autofill_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698