| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // and |app_locale| as hints when filling exceptional cases like phone number | 82 // and |app_locale| as hints when filling exceptional cases like phone number |
| 83 // values and <select> fields. Returns |true| if the field has been filled, | 83 // values and <select> fields. Returns |true| if the field has been filled, |
| 84 // |false| otherwise. | 84 // |false| otherwise. |
| 85 static bool FillFormField(const AutofillField& field, | 85 static bool FillFormField(const AutofillField& field, |
| 86 const base::string16& value, | 86 const base::string16& value, |
| 87 const std::string& address_language_code, | 87 const std::string& address_language_code, |
| 88 const std::string& app_locale, | 88 const std::string& app_locale, |
| 89 FormFieldData* field_data); | 89 FormFieldData* field_data); |
| 90 | 90 |
| 91 // Returns the phone number value for the given |field|. The returned value | 91 // Returns the phone number value for the given |field|. The returned value |
| 92 // might be |number|, or could possibly be a prefix or suffix of |number| | 92 // might be |number|, or could possibly be a meaningful subset |number|, if |
| 93 // if that's appropriate for the field. | 93 // that's appropriate for the field. |
| 94 static base::string16 GetPhoneNumberValue(const AutofillField& field, | 94 static base::string16 GetPhoneNumberValue(const AutofillField& field, |
| 95 const base::string16& number, | 95 const base::string16& number, |
| 96 const FormFieldData& field_data); | 96 const FormFieldData& field_data); |
| 97 | 97 |
| 98 // Returns true if the select |field| contains an option that matches |value|. | 98 // Returns true if the select |field| contains an option that matches |value|. |
| 99 // If the return value is true and |index| is non-NULL, write the index of the | 99 // If the return value is true and |index| is non-NULL, write the index of the |
| 100 // matching option into |index|. | 100 // matching option into |index|. |
| 101 static bool FindValueInSelectControl(const FormFieldData& field, | 101 static bool FindValueInSelectControl(const FormFieldData& field, |
| 102 const base::string16& value, | 102 const base::string16& value, |
| 103 size_t* index); | 103 size_t* index); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 // Whether the field was autofilled then later edited. | 139 // Whether the field was autofilled then later edited. |
| 140 bool previously_autofilled_; | 140 bool previously_autofilled_; |
| 141 | 141 |
| 142 DISALLOW_COPY_AND_ASSIGN(AutofillField); | 142 DISALLOW_COPY_AND_ASSIGN(AutofillField); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace autofill | 145 } // namespace autofill |
| 146 | 146 |
| 147 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 147 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
| OLD | NEW |