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

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

Issue 1411363003: [Autofill] Always show available data when encountering autocomplete attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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 1777e50a42cebbd82f8ca9bd71f8e257d32db4e3..ae9ea9307ba67e30c064afdf7ef89b299ed18ebb 100644
--- a/components/autofill/core/browser/form_structure.h
+++ b/components/autofill/core/browser/form_structure.h
@@ -132,12 +132,12 @@ class FormStructure {
// Classifies each field in |fields_| based upon its |autocomplete| attribute,
// if the attribute is available. The association is stored into the field's
// |heuristic_type|.
- // Fills |found_types| with |true| if the attribute is available and neither
- // empty nor set to the special values "on" or "off" for at least one field.
- // Fills |found_sections| with |true| if the attribute specifies a section for
+ // Fills |has_author_specified_types_| with |true| if the attribute is
+ // available and neither empty nor set to the special values "on" or "off" for
// at least one field.
- void ParseFieldTypesFromAutocompleteAttributes(bool* found_types,
- bool* found_sections);
+ // Fills |has_author_specified_sections_| with |true| if the attribute
+ // specifies a section for at least one field.
+ void ParseFieldTypesFromAutocompleteAttributes();
// Determines whether |type| and |field| match.
typedef base::Callback<bool(ServerFieldType type,
@@ -192,6 +192,12 @@ class FormStructure {
bool has_password_field() const { return has_password_field_; }
+ bool has_author_specified_types() { return has_author_specified_types_; }
+
+ bool has_author_specified_sections() {
+ return has_author_specified_sections_;
+ }
+
void set_upload_required(UploadRequired required) {
upload_required_ = required;
}
@@ -265,6 +271,15 @@ class FormStructure {
// author, via the |autocompletetype| attribute.
bool has_author_specified_types_;
+ // Whether the form includes any sections explicitly specified by the site
+ // author, via the autocomplete attribute.
+ bool has_author_specified_sections_;
+
+ // Whether the form was parsed for autocomplete attribute, thus assigning
+ // the real values of |has_author_specified_types_| and
+ // |has_author_specified_sections_|.
+ bool was_parsed_for_autocomplete_attributes_;
+
// True if the form contains at least one password field.
bool has_password_field_;

Powered by Google App Engine
This is Rietveld 408576698