ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / components / autofill / core / browser / address_field.h
blob1966ac490373a9b96a9c357789c57a9fd5c6209c
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_ADDRESS_FIELD_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/strings/string16.h"
15 #include "components/autofill/core/browser/autofill_type.h"
16 #include "components/autofill/core/browser/form_field.h"
18 namespace autofill {
20 class AutofillField;
21 class AutofillScanner;
23 class AddressField : public FormField {
24 public:
25 static scoped_ptr<FormField> Parse(AutofillScanner* scanner);
27 protected:
28 // FormField:
29 bool ClassifyField(ServerFieldTypeMap* map) const override;
31 private:
32 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseOneLineAddress);
33 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddress);
34 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseThreeLineAddress);
35 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStreetAddressFromTextArea);
36 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCity);
37 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseState);
38 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseZip);
39 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseStateAndZipOneLabel);
40 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCountry);
41 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseTwoLineAddressMissingLabel);
42 FRIEND_TEST_ALL_PREFIXES(AddressFieldTest, ParseCompany);
44 AddressField();
46 bool ParseCompany(AutofillScanner* scanner);
47 bool ParseAddressLines(AutofillScanner* scanner);
48 bool ParseCountry(AutofillScanner* scanner);
49 bool ParseZipCode(AutofillScanner* scanner);
50 bool ParseCity(AutofillScanner* scanner);
51 bool ParseState(AutofillScanner* scanner);
53 AutofillField* company_;
54 AutofillField* address1_;
55 AutofillField* address2_;
56 AutofillField* address3_;
57 AutofillField* street_address_;
58 AutofillField* city_;
59 AutofillField* state_;
60 AutofillField* zip_;
61 AutofillField* zip4_; // optional ZIP+4; we don't fill this yet.
62 AutofillField* country_;
64 DISALLOW_COPY_AND_ASSIGN(AddressField);
67 } // namespace autofill
69 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_