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 <memory> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "components/autofill/core/browser/autofill_field.h" | 14 #include "components/autofill/core/browser/autofill_field.h" |
15 #include "components/autofill/core/browser/form_field.h" | 15 #include "components/autofill/core/browser/form_field.h" |
16 | 16 |
17 namespace autofill { | 17 namespace autofill { |
18 | 18 |
19 class AutofillScanner; | 19 class AutofillScanner; |
20 | 20 |
21 // A form field that can parse either a FullNameField or a FirstLastNameField. | 21 // A form field that can parse either a FullNameField or a FirstLastNameField. |
22 class NameField : public FormField { | 22 class NameField : public FormField { |
23 public: | 23 public: |
24 static scoped_ptr<FormField> Parse(AutofillScanner* scanner); | 24 static std::unique_ptr<FormField> Parse(AutofillScanner* scanner); |
25 | 25 |
26 protected: | 26 protected: |
27 NameField() {} | 27 NameField() {} |
28 | 28 |
29 void AddClassifications(FieldCandidatesMap* field_candidates) const override; | 29 void AddClassifications(FieldCandidatesMap* field_candidates) const override; |
30 | 30 |
31 private: | 31 private: |
32 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast); | 32 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast); |
33 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast2); | 33 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast2); |
34 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast); | 34 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast); |
35 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast2); | 35 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast2); |
36 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastMiddleWithSpaces); | 36 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastMiddleWithSpaces); |
37 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastEmpty); | 37 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastEmpty); |
38 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLastEmpty); | 38 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLastEmpty); |
39 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitial); | 39 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitial); |
40 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitialAtEnd); | 40 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitialAtEnd); |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(NameField); | 42 DISALLOW_COPY_AND_ASSIGN(NameField); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace autofill | 45 } // namespace autofill |
46 | 46 |
47 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_NAME_FIELD_H_ | 47 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_NAME_FIELD_H_ |
OLD | NEW |