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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // input type in a 32-bit hash. | 58 // input type in a 32-bit hash. |
59 std::string FieldSignature() const; | 59 std::string FieldSignature() const; |
60 | 60 |
61 // Returns true if the field type has been determined (without the text in the | 61 // Returns true if the field type has been determined (without the text in the |
62 // field). | 62 // field). |
63 bool IsFieldFillable() const; | 63 bool IsFieldFillable() const; |
64 | 64 |
65 void set_default_value(const std::string& value) { default_value_ = value; } | 65 void set_default_value(const std::string& value) { default_value_ = value; } |
66 const std::string& default_value() const { return default_value_; } | 66 const std::string& default_value() const { return default_value_; } |
67 | 67 |
68 // Set |field_data|'s value to |value|. Uses |field| and |app_locale| as | 68 // Set |field_data|'s value to |value|. Uses |field|, |address_language_code|, |
69 // hints when filling exceptional cases like phone number values and <select> | 69 // and |app_locale| as hints when filling exceptional cases like phone number |
70 // fields. Returns |true| if the field has been filled, |false| otherwise. | 70 // values and <select> fields. Returns |true| if the field has been filled, |
| 71 // |false| otherwise. |
71 static bool FillFormField(const AutofillField& field, | 72 static bool FillFormField(const AutofillField& field, |
72 const base::string16& value, | 73 const base::string16& value, |
| 74 const std::string& address_language_code, |
73 const std::string& app_locale, | 75 const std::string& app_locale, |
74 FormFieldData* field_data); | 76 FormFieldData* field_data); |
75 | 77 |
76 private: | 78 private: |
77 // The unique name of this field, generated by Autofill. | 79 // The unique name of this field, generated by Autofill. |
78 base::string16 unique_name_; | 80 base::string16 unique_name_; |
79 | 81 |
80 // The unique identifier for the section (e.g. billing vs. shipping address) | 82 // The unique identifier for the section (e.g. billing vs. shipping address) |
81 // that this field belongs to. | 83 // that this field belongs to. |
82 std::string section_; | 84 std::string section_; |
(...skipping 19 matching lines...) Expand all Loading... |
102 | 104 |
103 // The default value returned by the Autofill server. | 105 // The default value returned by the Autofill server. |
104 std::string default_value_; | 106 std::string default_value_; |
105 | 107 |
106 DISALLOW_COPY_AND_ASSIGN(AutofillField); | 108 DISALLOW_COPY_AND_ASSIGN(AutofillField); |
107 }; | 109 }; |
108 | 110 |
109 } // namespace autofill | 111 } // namespace autofill |
110 | 112 |
111 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 113 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
OLD | NEW |