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

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

Issue 2877473002: Move autofill_regex_constants to core/common. (Closed)
Patch Set: Remove illegal dependency. Created 3 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
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/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "components/autofill/core/browser/autofill_regex_constants.h"
10 #include "components/autofill/core/browser/autofill_scanner.h" 9 #include "components/autofill/core/browser/autofill_scanner.h"
10 #include "components/autofill/core/common/autofill_regex_constants.h"
11 11
12 namespace autofill { 12 namespace autofill {
13 13
14 // static 14 // static
15 std::unique_ptr<FormField> EmailField::Parse(AutofillScanner* scanner) { 15 std::unique_ptr<FormField> EmailField::Parse(AutofillScanner* scanner) {
16 AutofillField* field; 16 AutofillField* field;
17 if (ParseFieldSpecifics(scanner, base::UTF8ToUTF16(kEmailRe), 17 if (ParseFieldSpecifics(scanner, base::UTF8ToUTF16(kEmailRe),
18 MATCH_DEFAULT | MATCH_EMAIL, &field)) { 18 MATCH_DEFAULT | MATCH_EMAIL, &field)) {
19 return base::WrapUnique(new EmailField(field)); 19 return base::WrapUnique(new EmailField(field));
20 } 20 }
21 21
22 return NULL; 22 return NULL;
23 } 23 }
24 24
25 EmailField::EmailField(const AutofillField* field) : field_(field) { 25 EmailField::EmailField(const AutofillField* field) : field_(field) {
26 } 26 }
27 27
28 void EmailField::AddClassifications( 28 void EmailField::AddClassifications(
29 FieldCandidatesMap* field_candidates) const { 29 FieldCandidatesMap* field_candidates) const {
30 AddClassification(field_, EMAIL_ADDRESS, kBaseEmailParserScore, 30 AddClassification(field_, EMAIL_ADDRESS, kBaseEmailParserScore,
31 field_candidates); 31 field_candidates);
32 } 32 }
33 33
34 } // namespace autofill 34 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/credit_card_field.cc ('k') | components/autofill/core/browser/name_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698