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

Unified Diff: chrome/browser/autofill/form_structure.cc

Issue 7639010: Update recognized 'autocompletetype' tokens with the most recent values from the spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | chrome/test/data/autofill/heuristics/input/01_autocompletetype_attribute.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/form_structure.cc
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
index 076e3c415a1eed0c567199075e91b3cd201c95bf..a557fb820825e5907e21685465b466477ef9b2a5 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -126,12 +126,16 @@ bool ConvertToAutofillFieldType(const AutofillField& field,
return true;
}
- if (autocomplete_type == ASCIIToUTF16("locality")) {
+ if (autocomplete_type == ASCIIToUTF16("locality") ||
+ autocomplete_type == ASCIIToUTF16("city")) {
*autofill_type = ADDRESS_HOME_CITY;
return true;
}
- if (autocomplete_type == ASCIIToUTF16("administrative-area")) {
+ if (autocomplete_type == ASCIIToUTF16("administrative-area") ||
+ autocomplete_type == ASCIIToUTF16("state") ||
+ autocomplete_type == ASCIIToUTF16("province") ||
+ autocomplete_type == ASCIIToUTF16("region")) {
*autofill_type = ADDRESS_HOME_STATE;
return true;
}
@@ -166,12 +170,21 @@ bool ConvertToAutofillFieldType(const AutofillField& field,
return true;
}
- if (autocomplete_type == ASCIIToUTF16("phone-city-code")) {
+ if (autocomplete_type == ASCIIToUTF16("phone-national")) {
+ *autofill_type = PHONE_HOME_CITY_AND_NUMBER;
+ return true;
+ }
+
+ if (autocomplete_type == ASCIIToUTF16("phone-area-code")) {
*autofill_type = PHONE_HOME_CITY_CODE;
return true;
}
- if (autocomplete_type == ASCIIToUTF16("phone-number")) {
+ // TODO(isherman): We should more fully support "phone-local-prefix" and
+ // "phone-local-suffix": http://crbug.com/92121
+ if (autocomplete_type == ASCIIToUTF16("phone-local") ||
+ autocomplete_type == ASCIIToUTF16("phone-local-prefix") ||
+ autocomplete_type == ASCIIToUTF16("phone-local-suffix")) {
*autofill_type = PHONE_HOME_NUMBER;
return true;
}
@@ -186,12 +199,21 @@ bool ConvertToAutofillFieldType(const AutofillField& field,
return true;
}
- if (autocomplete_type == ASCIIToUTF16("fax-city-code")) {
+ if (autocomplete_type == ASCIIToUTF16("fax-national")) {
+ *autofill_type = PHONE_FAX_CITY_AND_NUMBER;
+ return true;
+ }
+
+ if (autocomplete_type == ASCIIToUTF16("fax-area-code")) {
*autofill_type = PHONE_FAX_CITY_CODE;
return true;
}
- if (autocomplete_type == ASCIIToUTF16("fax-number")) {
+ // TODO(isherman): We should more fully support "fax-local-prefix" and
+ // "fax-local-suffix": http://crbug.com/92121
+ if (autocomplete_type == ASCIIToUTF16("fax-local") ||
+ autocomplete_type == ASCIIToUTF16("fax-local-prefix") ||
+ autocomplete_type == ASCIIToUTF16("fax-local-suffix")) {
*autofill_type = PHONE_FAX_NUMBER;
return true;
}
« no previous file with comments | « no previous file | chrome/test/data/autofill/heuristics/input/01_autocompletetype_attribute.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698