OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_BROWSER_FORM_GROUP_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_FORM_GROUP_H_ |
6 #define COMPONENTS_AUTOFILL_BROWSER_FORM_GROUP_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_FORM_GROUP_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 size_t variant, | 68 size_t variant, |
69 const std::string& app_locale, | 69 const std::string& app_locale, |
70 FormFieldData* field_data) const; | 70 FormFieldData* field_data) const; |
71 | 71 |
72 // Fills in select control with data matching |type| from |this|. | 72 // Fills in select control with data matching |type| from |this|. |
73 // Public for testing purposes. | 73 // Public for testing purposes. |
74 void FillSelectControl(AutofillFieldType type, | 74 void FillSelectControl(AutofillFieldType type, |
75 const std::string& app_locale, | 75 const std::string& app_locale, |
76 FormFieldData* field_data) const; | 76 FormFieldData* field_data) const; |
77 | 77 |
78 // Returns true if |value| is a valid US state name or abbreviation. It is | |
79 // case insensitive. Valid for US states only. | |
80 // TODO(estade): this is a crappy place for this function. | |
81 static bool IsValidState(const base::string16& value); | |
82 | |
83 protected: | 78 protected: |
84 // AutofillProfile needs to call into GetSupportedTypes() for objects of | 79 // AutofillProfile needs to call into GetSupportedTypes() for objects of |
85 // non-AutofillProfile type, for which mere inheritance is insufficient. | 80 // non-AutofillProfile type, for which mere inheritance is insufficient. |
86 friend class AutofillProfile; | 81 friend class AutofillProfile; |
87 | 82 |
88 // Returns a set of AutofillFieldTypes for which this FormGroup can store | 83 // Returns a set of AutofillFieldTypes for which this FormGroup can store |
89 // data. This method is additive on |supported_types|. | 84 // data. This method is additive on |supported_types|. |
90 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const = 0; | 85 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const = 0; |
91 | 86 |
92 // Fills in a select control for a country from data in |this|. Returns true | 87 // Fills in a select control for a country from data in |this|. Returns true |
93 // for success. | 88 // for success. |
94 virtual bool FillCountrySelectControl(const std::string& app_locale, | 89 virtual bool FillCountrySelectControl(const std::string& app_locale, |
95 FormFieldData* field_data) const; | 90 FormFieldData* field_data) const; |
96 }; | 91 }; |
97 | 92 |
98 } // namespace autofill | 93 } // namespace autofill |
99 | 94 |
100 #endif // COMPONENTS_AUTOFILL_BROWSER_FORM_GROUP_H_ | 95 #endif // COMPONENTS_AUTOFILL_BROWSER_FORM_GROUP_H_ |
OLD | NEW |