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