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

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: Fix browser test 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 53826cd2ec0ff8856b0a5e1b9a297085ede68b1f..6f57484d5355bf3a92346d8b8d82839bb6cf6d0f 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_; }
ServerFieldType heuristic_type() const { return heuristic_type_; }
ServerFieldType server_type() const { return server_type_; }
+ HtmlFieldType html_type() const { return html_type_; }
+ HtmlFieldMode html_mode() const { return html_mode_; }
const ServerFieldTypeSet& 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(ServerFieldType type);
void set_server_type(ServerFieldType type);
void set_possible_types(const ServerFieldTypeSet& 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.
ServerFieldType 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.
ServerFieldTypeSet possible_types_;
« no previous file with comments | « components/autofill/core/browser/autofill_data_model.cc ('k') | components/autofill/core/browser/autofill_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698