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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool ShouldBeCrowdsourced() const; | 102 bool ShouldBeCrowdsourced() const; |
103 | 103 |
104 // Sets the field types and experiment id to be those set for |cached_form|. | 104 // Sets the field types and experiment id to be those set for |cached_form|. |
105 void UpdateFromCache(const FormStructure& cached_form); | 105 void UpdateFromCache(const FormStructure& cached_form); |
106 | 106 |
107 // Logs quality metrics for |this|, which should be a user-submitted form. | 107 // Logs quality metrics for |this|, which should be a user-submitted form. |
108 // This method should only be called after the possible field types have been | 108 // This method should only be called after the possible field types have been |
109 // set for each field. | 109 // set for each field. |
110 void LogQualityMetrics(const AutofillMetrics& metric_logger) const; | 110 void LogQualityMetrics(const AutofillMetrics& metric_logger) const; |
111 | 111 |
112 // Sets the possible types for the field at |index|. | |
113 void set_possible_types(size_t index, const FieldTypeSet& types); | |
114 | |
115 const AutofillField* field(size_t index) const; | 112 const AutofillField* field(size_t index) const; |
| 113 AutofillField* field(size_t index); |
116 size_t field_count() const; | 114 size_t field_count() const; |
117 | 115 |
118 // Returns the number of fields that are able to be autofilled. | 116 // Returns the number of fields that are able to be autofilled. |
119 size_t autofill_count() const { return autofill_count_; } | 117 size_t autofill_count() const { return autofill_count_; } |
120 | 118 |
121 // Used for iterating over the fields. | 119 // Used for iterating over the fields. |
122 std::vector<AutofillField*>::const_iterator begin() const { | 120 std::vector<AutofillField*>::const_iterator begin() const { |
123 return fields_.begin(); | 121 return fields_.begin(); |
124 } | 122 } |
125 std::vector<AutofillField*>::const_iterator end() const { | 123 std::vector<AutofillField*>::const_iterator end() const { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 RequestMethod method_; | 199 RequestMethod method_; |
202 | 200 |
203 // Whether the form includes any field types explicitly specified by the site | 201 // Whether the form includes any field types explicitly specified by the site |
204 // author, via the |autocompletetype| attribute. | 202 // author, via the |autocompletetype| attribute. |
205 bool has_author_specified_types_; | 203 bool has_author_specified_types_; |
206 | 204 |
207 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 205 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
208 }; | 206 }; |
209 | 207 |
210 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ | 208 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ |
OLD | NEW |