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