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

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

Issue 7014011: Change heuristic regex and order to match grabber-continental. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move IsTextInput() check. Created 9 years, 7 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 | « chrome/browser/autofill/name_field.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/phone_field.cc
diff --git a/chrome/browser/autofill/phone_field.cc b/chrome/browser/autofill/phone_field.cc
index 7306764f67df9cda053c073fe9543b48e1bc6653..32b735e83f5016731b7bd3430ae68e7b85d4d219 100644
--- a/chrome/browser/autofill/phone_field.cc
+++ b/chrome/browser/autofill/phone_field.cc
@@ -124,7 +124,8 @@ PhoneField* PhoneField::ParseECML(AutofillScanner* scanner) {
string16 pattern(GetEcmlPattern(kEcmlShipToPhone, kEcmlBillToPhone, '|'));
const AutofillField* field;
- if (ParseText(scanner, pattern, &field)) {
+ if (ParseText(scanner, pattern, MATCH_NAME | MATCH_LABEL | MATCH_TEXT,
+ &field)) {
PhoneField* phone_field = new PhoneField();
phone_field->parsed_phone_fields_[FIELD_PHONE] = field;
return phone_field;
@@ -268,6 +269,7 @@ bool PhoneField::ParseInternal(PhoneField *phone_field,
phone_field_grammars_[i].regex != REGEX_SEPARATOR; ++i) {
if (!ParseText(scanner,
phone_field->GetRegExp(phone_field_grammars_[i].regex),
+ MATCH_NAME | MATCH_LABEL | MATCH_TEXT,
&parsed_fields[phone_field_grammars_[i].phone_part]))
break;
if (phone_field_grammars_[i].max_size &&
@@ -310,14 +312,17 @@ bool PhoneField::ParseInternal(PhoneField *phone_field,
// Look for a third text box.
if (!phone_field->parsed_phone_fields_[FIELD_SUFFIX]) {
if (!ParseText(scanner, phone_field->GetSuffixRegex(),
+ MATCH_NAME | MATCH_LABEL | MATCH_TEXT,
&phone_field->parsed_phone_fields_[FIELD_SUFFIX])) {
ParseText(scanner, phone_field->GetSuffixSeparatorRegex(),
+ MATCH_NAME | MATCH_LABEL | MATCH_TEXT,
&phone_field->parsed_phone_fields_[FIELD_SUFFIX]);
}
}
// Now look for an extension.
ParseText(scanner, phone_field->GetExtensionRegex(),
+ MATCH_NAME | MATCH_LABEL | MATCH_TEXT,
&phone_field->parsed_phone_fields_[FIELD_EXTENSION]);
return true;
« no previous file with comments | « chrome/browser/autofill/name_field.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698