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 CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ |
6 #define CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ | 6 #define CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Fills |found_types| with |true| if the attribute is available and neither | 120 // Fills |found_types| with |true| if the attribute is available and neither |
121 // empty nor set to the special values "on" or "off" for at least one field. | 121 // empty nor set to the special values "on" or "off" for at least one field. |
122 // Fills |found_sections| with |true| if the attribute specifies a section for | 122 // Fills |found_sections| with |true| if the attribute specifies a section for |
123 // at least one field. | 123 // at least one field. |
124 void ParseFieldTypesFromAutocompleteAttributes(bool* found_types, | 124 void ParseFieldTypesFromAutocompleteAttributes(bool* found_types, |
125 bool* found_sections); | 125 bool* found_sections); |
126 | 126 |
127 const AutofillField* field(size_t index) const; | 127 const AutofillField* field(size_t index) const; |
128 AutofillField* field(size_t index); | 128 AutofillField* field(size_t index); |
129 size_t field_count() const; | 129 size_t field_count() const; |
| 130 size_t checkable_field_count() const; |
130 | 131 |
131 // Returns the number of fields that are able to be autofilled. | 132 // Returns the number of fields that are able to be autofilled. |
132 size_t autofill_count() const { return autofill_count_; } | 133 size_t autofill_count() const { return autofill_count_; } |
133 | 134 |
134 // Used for iterating over the fields. | 135 // Used for iterating over the fields. |
135 std::vector<AutofillField*>::const_iterator begin() const { | 136 std::vector<AutofillField*>::const_iterator begin() const { |
136 return fields_.begin(); | 137 return fields_.begin(); |
137 } | 138 } |
138 std::vector<AutofillField*>::const_iterator end() const { | 139 std::vector<AutofillField*>::const_iterator end() const { |
139 return fields_.end(); | 140 return fields_.end(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 186 |
186 // The target URL. | 187 // The target URL. |
187 GURL target_url_; | 188 GURL target_url_; |
188 | 189 |
189 // The number of fields able to be auto-filled. | 190 // The number of fields able to be auto-filled. |
190 size_t autofill_count_; | 191 size_t autofill_count_; |
191 | 192 |
192 // A vector of all the input fields in the form. | 193 // A vector of all the input fields in the form. |
193 ScopedVector<AutofillField> fields_; | 194 ScopedVector<AutofillField> fields_; |
194 | 195 |
| 196 // The number of fields able to be checked. |
| 197 size_t checkable_field_count_; |
| 198 |
195 // The names of the form input elements, that are part of the form signature. | 199 // The names of the form input elements, that are part of the form signature. |
196 // The string starts with "&" and the names are also separated by the "&" | 200 // The string starts with "&" and the names are also separated by the "&" |
197 // character. E.g.: "&form_input1_name&form_input2_name&...&form_inputN_name" | 201 // character. E.g.: "&form_input1_name&form_input2_name&...&form_inputN_name" |
198 std::string form_signature_field_names_; | 202 std::string form_signature_field_names_; |
199 | 203 |
200 // Whether the server expects us to always upload, never upload, or default | 204 // Whether the server expects us to always upload, never upload, or default |
201 // to the stored upload rates. | 205 // to the stored upload rates. |
202 UploadRequired upload_required_; | 206 UploadRequired upload_required_; |
203 | 207 |
204 // The server experiment corresponding to the server types returned for this | 208 // The server experiment corresponding to the server types returned for this |
205 // form. | 209 // form. |
206 std::string server_experiment_id_; | 210 std::string server_experiment_id_; |
207 | 211 |
208 // GET or POST. | 212 // GET or POST. |
209 RequestMethod method_; | 213 RequestMethod method_; |
210 | 214 |
211 // Whether the form includes any field types explicitly specified by the site | 215 // Whether the form includes any field types explicitly specified by the site |
212 // author, via the |autocompletetype| attribute. | 216 // author, via the |autocompletetype| attribute. |
213 bool has_author_specified_types_; | 217 bool has_author_specified_types_; |
214 | 218 |
215 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 219 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
216 }; | 220 }; |
217 | 221 |
218 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ | 222 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ |
OLD | NEW |