Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: chrome/browser/autofill/form_structure.h

Issue 11198048: [Autofill] Update the autocomplete types implementation to match the current HTML spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 enum EncodeRequestType { 147 enum EncodeRequestType {
148 QUERY, 148 QUERY,
149 UPLOAD, 149 UPLOAD,
150 }; 150 };
151 151
152 // Adds form info to |encompassing_xml_element|. |request_type| indicates if 152 // Adds form info to |encompassing_xml_element|. |request_type| indicates if
153 // it is a query or upload. 153 // it is a query or upload.
154 bool EncodeFormRequest(EncodeRequestType request_type, 154 bool EncodeFormRequest(EncodeRequestType request_type,
155 buzz::XmlElement* encompassing_xml_element) const; 155 buzz::XmlElement* encompassing_xml_element) const;
156 156
157 // Classifies each field in |fields_| based upon its |autocompletetype| 157 // Classifies each field in |fields_| based upon its |autocomplete| attribute,
158 // attribute, if the attribute is available. The association is stored into 158 // if the attribute is available. The association is stored into the field's
Dan Beam 2012/10/19 00:12:44 nit: I think generally I've been told to only put
Ilya Sherman 2012/10/19 04:19:32 David and I made an explicit decision to go with t
159 // |map|. Fills |found_attribute| with |true| if the attribute is available 159 // |heuristic_type|.
160 // (and non-empty) for at least one field. Fills |found_sections| with |true| 160 // Fills |found_types| with |true| if the attribute is available and neither
161 // if the attribute specifies a section for at least one field. 161 // empty nor set to the special valeus "on" or "off" for at least one field.
Dan Beam 2012/10/19 00:12:44 values
Ilya Sherman 2012/10/19 04:19:32 Done.
162 void ParseAutocompletetypeAttributes(bool* found_attribute, 162 // Fills |found_sections| with |true| if the attribute specifies a section for
163 bool* found_sections); 163 // at least one field.
164 void ParseFieldTypesFromAutocompleteAttributes(bool* found_types,
165 bool* found_sections);
164 166
165 // Classifies each field in |fields_| into a logical section. 167 // Classifies each field in |fields_| into a logical section.
166 // Sections are identified by the heuristic that a logical section should not 168 // Sections are identified by the heuristic that a logical section should not
167 // include multiple fields of the same autofill type (with some exceptions, as 169 // include multiple fields of the same autofill type (with some exceptions, as
168 // described in the implementation). Sections are furthermore distinguished 170 // described in the implementation). Sections are furthermore distinguished
169 // as either credit card or non-credit card sections. 171 // as either credit card or non-credit card sections.
170 // If |has_author_specified_sections| is true, only the second pass -- 172 // If |has_author_specified_sections| is true, only the second pass --
171 // distinguishing credit card sections from non-credit card ones -- is made. 173 // distinguishing credit card sections from non-credit card ones -- is made.
172 void IdentifySections(bool has_author_specified_sections); 174 void IdentifySections(bool has_author_specified_sections);
173 175
(...skipping 29 matching lines...) Expand all
203 RequestMethod method_; 205 RequestMethod method_;
204 206
205 // Whether the form includes any field types explicitly specified by the site 207 // Whether the form includes any field types explicitly specified by the site
206 // author, via the |autocompletetype| attribute. 208 // author, via the |autocompletetype| attribute.
207 bool has_author_specified_types_; 209 bool has_author_specified_types_;
208 210
209 DISALLOW_COPY_AND_ASSIGN(FormStructure); 211 DISALLOW_COPY_AND_ASSIGN(FormStructure);
210 }; 212 };
211 213
212 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ 214 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698