OLD | NEW |
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 #ifndef CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ |
6 #define CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ | 6 #define CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "chrome/browser/autofill/autofill_field.h" | 12 #include "chrome/browser/autofill/autofill_field.h" |
13 #include "chrome/browser/autofill/form_field.h" | 13 #include "chrome/browser/autofill/form_field.h" |
14 | 14 |
15 class AutofillScanner; | 15 class AutofillScanner; |
16 | 16 |
17 // A form field that can parse either a FullNameField or a FirstLastNameField. | 17 // A form field that can parse either a FullNameField or a FirstLastNameField. |
18 class NameField : public FormField { | 18 class NameField : public FormField { |
19 public: | 19 public: |
20 static FormField* Parse(AutofillScanner* scanner, bool parse_new_field_types); | 20 static FormField* Parse(AutofillScanner* scanner); |
21 | 21 |
22 protected: | 22 protected: |
23 NameField() {} | 23 NameField() {} |
24 | 24 |
25 // FormField: | 25 // FormField: |
26 virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE; | 26 virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE; |
27 | 27 |
28 private: | 28 private: |
29 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast); | 29 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast); |
30 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast2); | 30 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast2); |
31 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast); | 31 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast); |
32 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast2); | 32 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast2); |
33 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastMiddleWithSpaces); | 33 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastMiddleWithSpaces); |
34 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastEmpty); | 34 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastEmpty); |
35 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLastEmpty); | 35 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLastEmpty); |
36 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitial); | 36 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitial); |
37 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitialAtEnd); | 37 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitialAtEnd); |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(NameField); | 39 DISALLOW_COPY_AND_ASSIGN(NameField); |
40 }; | 40 }; |
41 | 41 |
42 #endif // CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ | 42 #endif // CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ |
OLD | NEW |