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_AUTOFILL_FIELD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // and |app_locale| as hints when filling exceptional cases like phone number | 86 // and |app_locale| as hints when filling exceptional cases like phone number |
87 // values and <select> fields. Returns |true| if the field has been filled, | 87 // values and <select> fields. Returns |true| if the field has been filled, |
88 // |false| otherwise. | 88 // |false| otherwise. |
89 static bool FillFormField(const AutofillField& field, | 89 static bool FillFormField(const AutofillField& field, |
90 const base::string16& value, | 90 const base::string16& value, |
91 const std::string& address_language_code, | 91 const std::string& address_language_code, |
92 const std::string& app_locale, | 92 const std::string& app_locale, |
93 FormFieldData* field_data); | 93 FormFieldData* field_data); |
94 | 94 |
95 // Returns the phone number value for the given |field|. The returned value | 95 // Returns the phone number value for the given |field|. The returned value |
96 // might be |number|, or could possibly be a prefix or suffix of |number| | 96 // might be |number|, or could possibly be a meaningful subset |number|, if |
97 // if that's appropriate for the field. | 97 // that's appropriate for the field. |
98 static base::string16 GetPhoneNumberValue(const AutofillField& field, | 98 static base::string16 GetPhoneNumberValue(const AutofillField& field, |
99 const base::string16& number, | 99 const base::string16& number, |
100 const FormFieldData& field_data); | 100 const FormFieldData& field_data); |
101 | 101 |
102 // Returns true if the select |field| contains an option that matches |value|. | 102 // Returns true if the select |field| contains an option that matches |value|. |
103 // If the return value is true and |index| is non-NULL, write the index of the | 103 // If the return value is true and |index| is non-NULL, write the index of the |
104 // matching option into |index|. | 104 // matching option into |index|. |
105 static bool FindValueInSelectControl(const FormFieldData& field, | 105 static bool FindValueInSelectControl(const FormFieldData& field, |
106 const base::string16& value, | 106 const base::string16& value, |
107 size_t* index); | 107 size_t* index); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // a common prefix shared with other fields). Will be used for heuristics | 147 // a common prefix shared with other fields). Will be used for heuristics |
148 // parsing. | 148 // parsing. |
149 base::string16 parseable_name_; | 149 base::string16 parseable_name_; |
150 | 150 |
151 DISALLOW_COPY_AND_ASSIGN(AutofillField); | 151 DISALLOW_COPY_AND_ASSIGN(AutofillField); |
152 }; | 152 }; |
153 | 153 |
154 } // namespace autofill | 154 } // namespace autofill |
155 | 155 |
156 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 156 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
OLD | NEW |