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

Side by Side Diff: chrome/browser/autofill/email_field.cc

Issue 12260054: [Autofill] Enable heuristic detection of credit card issuer fields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 10 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/email_field.h ('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 "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autofill/autofill_regex_constants.h" 8 #include "chrome/browser/autofill/autofill_regex_constants.h"
9 #include "chrome/browser/autofill/autofill_scanner.h" 9 #include "chrome/browser/autofill/autofill_scanner.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
11 11
12 // static 12 // static
13 FormField* EmailField::Parse(AutofillScanner* scanner, 13 FormField* EmailField::Parse(AutofillScanner* scanner) {
14 bool parse_new_field_types) {
15 const AutofillField* field; 14 const AutofillField* field;
16 if (ParseFieldSpecifics(scanner, UTF8ToUTF16(autofill::kEmailRe), 15 if (ParseFieldSpecifics(scanner, UTF8ToUTF16(autofill::kEmailRe),
17 MATCH_DEFAULT | MATCH_EMAIL, &field)) { 16 MATCH_DEFAULT | MATCH_EMAIL, &field)) {
18 return new EmailField(field); 17 return new EmailField(field);
19 } 18 }
20 19
21 return NULL; 20 return NULL;
22 } 21 }
23 22
24 EmailField::EmailField(const AutofillField* field) : field_(field) { 23 EmailField::EmailField(const AutofillField* field) : field_(field) {
25 } 24 }
26 25
27 bool EmailField::ClassifyField(FieldTypeMap* map) const { 26 bool EmailField::ClassifyField(FieldTypeMap* map) const {
28 return AddClassification(field_, EMAIL_ADDRESS, map); 27 return AddClassification(field_, EMAIL_ADDRESS, map);
29 } 28 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/email_field.h ('k') | chrome/browser/autofill/form_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698