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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_NAME_FIELD_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_NAME_FIELD_H_
10 #include "base/compiler_specific.h"
11 #include "base/gtest_prod_util.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "components/autofill/core/browser/autofill_field.h"
14 #include "components/autofill/core/browser/form_field.h"
18 class AutofillScanner
;
20 // A form field that can parse either a FullNameField or a FirstLastNameField.
21 class NameField
: public FormField
{
23 static scoped_ptr
<FormField
> Parse(AutofillScanner
* scanner
);
29 bool ClassifyField(ServerFieldTypeMap
* map
) const override
;
32 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, FirstMiddleLast
);
33 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, FirstMiddleLast2
);
34 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, FirstLast
);
35 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, FirstLast2
);
36 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, FirstLastMiddleWithSpaces
);
37 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, FirstLastEmpty
);
38 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, FirstMiddleLastEmpty
);
39 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, MiddleInitial
);
40 FRIEND_TEST_ALL_PREFIXES(NameFieldTest
, MiddleInitialAtEnd
);
42 DISALLOW_COPY_AND_ASSIGN(NameField
);
45 } // namespace autofill
47 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_NAME_FIELD_H_