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

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

Issue 1028633004: Autofill: Improve heuristics for city/state/zip fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment Created 5 years, 9 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/address_field.h
diff --git a/components/autofill/core/browser/address_field.h b/components/autofill/core/browser/address_field.h
index 1966ac490373a9b96a9c357789c57a9fd5c6209c..721545e036a2c3a4c6c6a336036040ea90359c43 100644
--- a/components/autofill/core/browser/address_field.h
+++ b/components/autofill/core/browser/address_field.h
@@ -41,6 +41,10 @@ class AddressField : public FormField {
FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddressMissingLabel);
FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCompany);
+ static const int kZipCodeMatchType;
+ static const int kCityMatchType;
+ static const int kStateMatchType;
+
AddressField();
bool ParseCompany(AutofillScanner* scanner);
@@ -50,6 +54,17 @@ class AddressField : public FormField {
bool ParseCity(AutofillScanner* scanner);
bool ParseState(AutofillScanner* scanner);
+ // Parses the current field pointed to by |scanner|, if it exists, and tries
+ // to figure out whether the field's type: city, state, zip, or none of those.
+ bool ParseCityStateZipCode(AutofillScanner* scanner);
+
+ // Run matches on the name and label separately. If the return result is
+ // RESULT_MATCH_NAME_LABEL, then |scanner| advances and the field is set.
+ // Otherwise |scanner| rewinds and the field is cleared.
+ ParseNameLabelResult ParseNameAndLabelForZipCode(AutofillScanner* scanner);
+ ParseNameLabelResult ParseNameAndLabelForCity(AutofillScanner* scanner);
+ ParseNameLabelResult ParseNameAndLabelForState(AutofillScanner* scanner);
+
AutofillField* company_;
AutofillField* address1_;
AutofillField* address2_;
« no previous file with comments | « chrome/test/data/autofill/heuristics/output/bug_463986.out ('k') | components/autofill/core/browser/address_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698