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

Unified Diff: components/autofill/core/browser/form_structure.h

Issue 659793005: [Password Generation] Always query password forms via Autofill (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More tests Created 6 years, 2 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/core/browser/form_structure.h
diff --git a/components/autofill/core/browser/form_structure.h b/components/autofill/core/browser/form_structure.h
index cead91f3b615310fd28f8b11d74af650ef95de92..7756e3d8719671c44aa4b6ece037e7ff8cd581dc 100644
--- a/components/autofill/core/browser/form_structure.h
+++ b/components/autofill/core/browser/form_structure.h
@@ -105,7 +105,11 @@ class FormStructure {
// Returns true if we should query the crowdsourcing server to determine this
// form's field types. If the form includes author-specified types, this will
- // return false.
+ // return false unless there are password fields in the form. If there are no
+ // password fields the assumption is that the author has expressed their
+ // intent and crowdsourced data should not be used to override this. Password
+ // fields are different because there is no way to specify password generation
+ // directly.
bool ShouldBeCrowdsourced() const;
// Sets the field types to be those set for |cached_form|.
@@ -218,6 +222,10 @@ class FormStructure {
// Returns true if field should be skipped when talking to Autofill server.
bool ShouldSkipField(const FormFieldData& field) const;
+ // Returns true if the request was made for passwords only, and non-password
+ // fields should respect the autofill values set by the user.
+ bool ShouldSkipProcessingNonPasswordFields() const;
+
size_t active_field_count() const;
// The name of the form.
@@ -252,6 +260,9 @@ class FormStructure {
// author, via the |autocompletetype| attribute.
bool has_author_specified_types_;
+ // True if the form contains at least one password field.
+ bool has_password_field_;
+
DISALLOW_COPY_AND_ASSIGN(FormStructure);
};

Powered by Google App Engine
This is Rietveld 408576698