| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Classifies each field in |fields_| based upon its |autocomplete| attribute, | 117 // Classifies each field in |fields_| based upon its |autocomplete| attribute, |
| 118 // if the attribute is available. The association is stored into the field's | 118 // if the attribute is available. The association is stored into the field's |
| 119 // |heuristic_type|. | 119 // |heuristic_type|. |
| 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 // Returns true if the autofill server says that the current page is start of |
| 128 // the autofillable flow. |
| 129 bool IsStartOfAutofillableFlow() const; |
| 130 |
| 131 // Returns true if the autofill server says that the current page is in the |
| 132 // autofillable flow. |
| 133 bool IsInAutofillableFlow() const; |
| 134 |
| 127 const AutofillField* field(size_t index) const; | 135 const AutofillField* field(size_t index) const; |
| 128 AutofillField* field(size_t index); | 136 AutofillField* field(size_t index); |
| 129 size_t field_count() const; | 137 size_t field_count() const; |
| 130 | 138 |
| 131 // Returns the number of fields that are able to be autofilled. | 139 // Returns the number of fields that are able to be autofilled. |
| 132 size_t autofill_count() const { return autofill_count_; } | 140 size_t autofill_count() const { return autofill_count_; } |
| 133 | 141 |
| 134 // Used for iterating over the fields. | 142 // Used for iterating over the fields. |
| 135 std::vector<AutofillField*>::const_iterator begin() const { | 143 std::vector<AutofillField*>::const_iterator begin() const { |
| 136 return fields_.begin(); | 144 return fields_.begin(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // to the stored upload rates. | 209 // to the stored upload rates. |
| 202 UploadRequired upload_required_; | 210 UploadRequired upload_required_; |
| 203 | 211 |
| 204 // The server experiment corresponding to the server types returned for this | 212 // The server experiment corresponding to the server types returned for this |
| 205 // form. | 213 // form. |
| 206 std::string server_experiment_id_; | 214 std::string server_experiment_id_; |
| 207 | 215 |
| 208 // GET or POST. | 216 // GET or POST. |
| 209 RequestMethod method_; | 217 RequestMethod method_; |
| 210 | 218 |
| 219 // Page number of the autofill flow this form belongs to (zero-indexed). |
| 220 // If this form doesn't belong to any autofill flow, it is set to -1. |
| 221 int current_page_number_; |
| 222 |
| 223 // Total number of pages in the autofill flow. If this form doesn't belong |
| 224 // to any autofill flow, it is set to -1. |
| 225 int total_pages_; |
| 226 |
| 211 // Whether the form includes any field types explicitly specified by the site | 227 // Whether the form includes any field types explicitly specified by the site |
| 212 // author, via the |autocompletetype| attribute. | 228 // author, via the |autocompletetype| attribute. |
| 213 bool has_author_specified_types_; | 229 bool has_author_specified_types_; |
| 214 | 230 |
| 215 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 231 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
| 216 }; | 232 }; |
| 217 | 233 |
| 218 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ | 234 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ |
| OLD | NEW |