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

Side by Side Diff: chrome/browser/autofill/email_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autofill/credit_card_field.cc ('k') | chrome/browser/autofill/form_field.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/autofill/email_field.h" 5 #include "chrome/browser/autofill/email_field.h"
6 6
7 #include "chrome/browser/autofill/autofill_scanner.h" 7 #include "chrome/browser/autofill/autofill_scanner.h"
8 #include "grit/autofill_resources.h" 8 #include "grit/autofill_resources.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 10
11 // static 11 // static
12 EmailField* EmailField::Parse(AutofillScanner* scanner, bool is_ecml) { 12 EmailField* EmailField::Parse(AutofillScanner* scanner, bool is_ecml) {
13 string16 pattern; 13 string16 pattern;
14 if (is_ecml) 14 if (is_ecml)
15 pattern = GetEcmlPattern(kEcmlShipToEmail, kEcmlBillToEmail, '|'); 15 pattern = GetEcmlPattern(kEcmlShipToEmail, kEcmlBillToEmail, '|');
16 else 16 else
17 pattern = l10n_util::GetStringUTF16(IDS_AUTOFILL_EMAIL_RE); 17 pattern = l10n_util::GetStringUTF16(IDS_AUTOFILL_EMAIL_RE);
18 18
19 const AutofillField* field; 19 const AutofillField* field;
20 if (ParseText(scanner, pattern, &field)) 20 if (ParseText(scanner, pattern, MATCH_NAME | MATCH_LABEL | MATCH_TEXT,
21 &field))
21 return new EmailField(field); 22 return new EmailField(field);
22 23
23 return NULL; 24 return NULL;
24 } 25 }
25 26
26 bool EmailField::GetFieldInfo(FieldTypeMap* field_type_map) const { 27 bool EmailField::GetFieldInfo(FieldTypeMap* field_type_map) const {
27 return Add(field_type_map, field_, EMAIL_ADDRESS); 28 return Add(field_type_map, field_, EMAIL_ADDRESS);
28 } 29 }
29 30
30 EmailField::EmailField(const AutofillField* field) : field_(field) { 31 EmailField::EmailField(const AutofillField* field) : field_(field) {
31 } 32 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/credit_card_field.cc ('k') | chrome/browser/autofill/form_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698