Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / components / autofill / core / browser / name_field.h
blobcb82cbba07e2a80fc7f9b5af587c670e55707c85
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_
8 #include <vector>
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"
16 namespace autofill {
18 class AutofillScanner;
20 // A form field that can parse either a FullNameField or a FirstLastNameField.
21 class NameField : public FormField {
22 public:
23 static scoped_ptr<FormField> Parse(AutofillScanner* scanner);
25 protected:
26 NameField() {}
28 // FormField:
29 bool ClassifyField(ServerFieldTypeMap* map) const override;
31 private:
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_