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_PHONE_FIELD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_FIELD_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_FIELD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_FIELD_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "components/autofill/core/browser/autofill_type.h" | 11 #include "components/autofill/core/browser/autofill_type.h" |
12 #include "components/autofill/core/browser/form_field.h" | 12 #include "components/autofill/core/browser/form_field.h" |
13 #include "components/autofill/core/browser/phone_number.h" | 13 #include "components/autofill/core/browser/phone_number.h" |
14 | 14 |
15 namespace autofill { | 15 namespace autofill { |
16 | 16 |
17 class AutofillField; | 17 class AutofillField; |
18 class AutofillScanner; | 18 class AutofillScanner; |
19 | 19 |
20 // A phone number in one of the following formats: | 20 // A phone number in one of the following formats: |
21 // - area code, prefix, suffix | 21 // - area code, prefix, suffix |
22 // - area code, number | 22 // - area code, number |
23 // - number | 23 // - number |
24 class PhoneField : public FormField { | 24 class PhoneField : public FormField { |
25 public: | 25 public: |
26 virtual ~PhoneField(); | 26 ~PhoneField() override; |
27 | 27 |
28 static FormField* Parse(AutofillScanner* scanner); | 28 static FormField* Parse(AutofillScanner* scanner); |
29 | 29 |
30 protected: | 30 protected: |
31 // FormField: | 31 // FormField: |
32 virtual bool ClassifyField(ServerFieldTypeMap* map) const override; | 32 bool ClassifyField(ServerFieldTypeMap* map) const override; |
33 | 33 |
34 private: | 34 private: |
35 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ParseOneLinePhone); | 35 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ParseOneLinePhone); |
36 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ParseTwoLinePhone); | 36 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ParseTwoLinePhone); |
37 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumber); | 37 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumber); |
38 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix); | 38 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix); |
39 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix2); | 39 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix2); |
40 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, CountryAndCityAndPhoneNumber); | 40 FRIEND_TEST_ALL_PREFIXES(PhoneFieldTest, CountryAndCityAndPhoneNumber); |
41 | 41 |
42 // This is for easy description of the possible parsing paths of the phone | 42 // This is for easy description of the possible parsing paths of the phone |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // FIELD_PHONE is always present; holds suffix if prefix is present. | 84 // FIELD_PHONE is always present; holds suffix if prefix is present. |
85 // The rest could be NULL. | 85 // The rest could be NULL. |
86 AutofillField* parsed_phone_fields_[FIELD_MAX]; | 86 AutofillField* parsed_phone_fields_[FIELD_MAX]; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(PhoneField); | 88 DISALLOW_COPY_AND_ASSIGN(PhoneField); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace autofill | 91 } // namespace autofill |
92 | 92 |
93 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_FIELD_H_ | 93 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PHONE_FIELD_H_ |
OLD | NEW |