| 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_FORM_STRUCTURE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 namespace autofill { | 37 namespace autofill { |
| 38 | 38 |
| 39 struct FormData; | 39 struct FormData; |
| 40 struct FormDataPredictions; | 40 struct FormDataPredictions; |
| 41 | 41 |
| 42 // FormStructure stores a single HTML form together with the values entered | 42 // FormStructure stores a single HTML form together with the values entered |
| 43 // in the fields along with additional information needed by Autofill. | 43 // in the fields along with additional information needed by Autofill. |
| 44 class FormStructure { | 44 class FormStructure { |
| 45 public: | 45 public: |
| 46 FormStructure(const FormData& form); | 46 explicit FormStructure(const FormData& form); |
| 47 virtual ~FormStructure(); | 47 virtual ~FormStructure(); |
| 48 | 48 |
| 49 // Runs several heuristics against the form fields to determine their possible | 49 // Runs several heuristics against the form fields to determine their possible |
| 50 // types. | 50 // types. |
| 51 void DetermineHeuristicTypes(); | 51 void DetermineHeuristicTypes(); |
| 52 | 52 |
| 53 // Encodes the XML upload request from this FormStructure. | 53 // Encodes the XML upload request from this FormStructure. |
| 54 bool EncodeUploadRequest(const ServerFieldTypeSet& available_field_types, | 54 bool EncodeUploadRequest(const ServerFieldTypeSet& available_field_types, |
| 55 bool form_was_autofilled, | 55 bool form_was_autofilled, |
| 56 std::string* encoded_xml) const; | 56 std::string* encoded_xml) const; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // to the stored upload rates. | 247 // to the stored upload rates. |
| 248 UploadRequired upload_required_; | 248 UploadRequired upload_required_; |
| 249 | 249 |
| 250 // Whether the form includes any field types explicitly specified by the site | 250 // Whether the form includes any field types explicitly specified by the site |
| 251 // author, via the |autocompletetype| attribute. | 251 // author, via the |autocompletetype| attribute. |
| 252 bool has_author_specified_types_; | 252 bool has_author_specified_types_; |
| 253 | 253 |
| 254 // True if the form contains at least one password field. | 254 // True if the form contains at least one password field. |
| 255 bool has_password_field_; | 255 bool has_password_field_; |
| 256 | 256 |
| 257 // True if the form is a <form>. |
| 258 bool is_form_tag_; |
| 259 |
| 257 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 260 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
| 258 }; | 261 }; |
| 259 | 262 |
| 260 } // namespace autofill | 263 } // namespace autofill |
| 261 | 264 |
| 262 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 265 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| OLD | NEW |