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

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

Issue 22040002: [Autofill] Add a separate enumeration for HTML field type hints. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add docs Created 7 years, 4 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/autofill_field.h
diff --git a/components/autofill/core/browser/autofill_field.h b/components/autofill/core/browser/autofill_field.h
index 1f8332828ab268e5bcbac35a998b6554360139e5..9a8fd25c68e02def82ee83f96a6f15acaa941660 100644
--- a/components/autofill/core/browser/autofill_field.h
+++ b/components/autofill/core/browser/autofill_field.h
@@ -33,17 +33,19 @@ class AutofillField : public FormFieldData {
const std::string& section() const { return section_; }
NativeFieldType heuristic_type() const { return heuristic_type_; }
NativeFieldType server_type() const { return server_type_; }
+ HtmlFieldType html_type() const { return html_type_; }
+ HtmlFieldMode html_mode() const { return html_mode_; }
const NativeFieldTypeSet& possible_types() const { return possible_types_; }
PhonePart phone_part() const { return phone_part_; }
- // Sets the heuristic type of this field, validating the input.
+ // Setters for the detected type and section for this field.
void set_section(const std::string& section) { section_ = section; }
void set_heuristic_type(NativeFieldType type);
void set_server_type(NativeFieldType type);
void set_possible_types(const NativeFieldTypeSet& possible_types) {
possible_types_ = possible_types;
}
- void set_phone_part(PhonePart part) { phone_part_ = part; }
+ void SetHtmlType(HtmlFieldType type, HtmlFieldMode mode);
// This function automatically chooses between server and heuristic autofill
// type, depending on the data available.
@@ -77,6 +79,13 @@ class AutofillField : public FormFieldData {
// The type of the field, as determined by the local heuristics.
NativeFieldType heuristic_type_;
+ // The type of the field, as specified by the site author in HTML.
+ HtmlFieldType html_type_;
+
+ // The "mode" of the field, as specified by the site author in HTML.
+ // Currently this is used to distinguish between billing and shipping fields.
+ HtmlFieldMode html_mode_;
+
// The set of possible types for this field.
NativeFieldTypeSet possible_types_;

Powered by Google App Engine
This is Rietveld 408576698