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

Side by Side Diff: components/autofill/browser/name_field.cc

Issue 12434004: Move remaining Autofill code to //components/autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix long lines Created 7 years, 9 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
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/name_field.h" 5 #include "components/autofill/browser/name_field.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/autofill/autofill_regex_constants.h" 11 #include "components/autofill/browser/autofill_regex_constants.h"
12 #include "chrome/browser/autofill/autofill_scanner.h" 12 #include "components/autofill/browser/autofill_scanner.h"
13 #include "chrome/browser/autofill/autofill_type.h" 13 #include "components/autofill/browser/autofill_type.h"
14 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
15 15
16 namespace { 16 namespace {
17 17
18 // A form field that can parse a full name field. 18 // A form field that can parse a full name field.
19 class FullNameField : public NameField { 19 class FullNameField : public NameField {
20 public: 20 public:
21 static FullNameField* Parse(AutofillScanner* scanner); 21 static FullNameField* Parse(AutofillScanner* scanner);
22 22
23 protected: 23 protected:
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 middle_initial_(false) { 205 middle_initial_(false) {
206 } 206 }
207 207
208 bool FirstLastNameField::ClassifyField(FieldTypeMap* map) const { 208 bool FirstLastNameField::ClassifyField(FieldTypeMap* map) const {
209 bool ok = AddClassification(first_name_, NAME_FIRST, map); 209 bool ok = AddClassification(first_name_, NAME_FIRST, map);
210 ok = ok && AddClassification(last_name_, NAME_LAST, map); 210 ok = ok && AddClassification(last_name_, NAME_LAST, map);
211 AutofillFieldType type = middle_initial_ ? NAME_MIDDLE_INITIAL : NAME_MIDDLE; 211 AutofillFieldType type = middle_initial_ ? NAME_MIDDLE_INITIAL : NAME_MIDDLE;
212 ok = ok && AddClassification(middle_name_, type, map); 212 ok = ok && AddClassification(middle_name_, type, map);
213 return ok; 213 return ok;
214 } 214 }
OLDNEW
« no previous file with comments | « components/autofill/browser/name_field.h ('k') | components/autofill/browser/name_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698