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

Side by Side Diff: components/autofill/core/browser/email_field.cc

Issue 1518783002: Revert of autofill: switch autofill_regexes to RE2 library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/core/browser/email_field.h" 5 #include "components/autofill/core/browser/email_field.h"
6 6
7 #include "base/strings/utf_string_conversions.h"
7 #include "components/autofill/core/browser/autofill_regex_constants.h" 8 #include "components/autofill/core/browser/autofill_regex_constants.h"
8 #include "components/autofill/core/browser/autofill_scanner.h" 9 #include "components/autofill/core/browser/autofill_scanner.h"
9 10
10 namespace autofill { 11 namespace autofill {
11 12
12 // static 13 // static
13 scoped_ptr<FormField> EmailField::Parse(AutofillScanner* scanner) { 14 scoped_ptr<FormField> EmailField::Parse(AutofillScanner* scanner) {
14 AutofillField* field; 15 AutofillField* field;
15 if (ParseFieldSpecifics(scanner, kEmailRe, MATCH_DEFAULT | MATCH_EMAIL, 16 if (ParseFieldSpecifics(scanner, base::UTF8ToUTF16(kEmailRe),
16 &field)) { 17 MATCH_DEFAULT | MATCH_EMAIL, &field)) {
17 return make_scoped_ptr(new EmailField(field)); 18 return make_scoped_ptr(new EmailField(field));
18 } 19 }
19 20
20 return NULL; 21 return NULL;
21 } 22 }
22 23
23 EmailField::EmailField(const AutofillField* field) : field_(field) { 24 EmailField::EmailField(const AutofillField* field) : field_(field) {
24 } 25 }
25 26
26 bool EmailField::ClassifyField(ServerFieldTypeMap* map) const { 27 bool EmailField::ClassifyField(ServerFieldTypeMap* map) const {
27 return AddClassification(field_, EMAIL_ADDRESS, map); 28 return AddClassification(field_, EMAIL_ADDRESS, map);
28 } 29 }
29 30
30 } // namespace autofill 31 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/credit_card_field.cc ('k') | components/autofill/core/browser/form_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698