| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 18 matching lines...) Expand all Loading... |
| 29 UPLOAD_REQUIRED, | 29 UPLOAD_REQUIRED, |
| 30 USE_UPLOAD_RATES | 30 USE_UPLOAD_RATES |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 // FormStructure stores a single HTML form together with the values entered | 33 // FormStructure stores a single HTML form together with the values entered |
| 34 // in the fields along with additional information needed by AutoFill. | 34 // in the fields along with additional information needed by AutoFill. |
| 35 class FormStructure { | 35 class FormStructure { |
| 36 public: | 36 public: |
| 37 explicit FormStructure(const webkit_glue::FormFieldValues& values); | 37 explicit FormStructure(const webkit_glue::FormFieldValues& values); |
| 38 | 38 |
| 39 // Encodes the XML upload request from this FormStructure. | 39 // Encodes the XML query or upload request from this FormStructure. |
| 40 bool EncodeUploadRequest(bool auto_fill_used, std::string* encoded_xml) const; | 40 // |query| - true means request is a query, upload otherwise. |
| 41 bool EncodeUploadRequest(bool auto_fill_used, bool query, |
| 42 std::string* encoded_xml) const; |
| 41 | 43 |
| 42 // Runs several heuristics against the form fields to determine their possible | 44 // Runs several heuristics against the form fields to determine their possible |
| 43 // types. | 45 // types. |
| 44 void GetHeuristicAutoFillTypes(); | 46 void GetHeuristicAutoFillTypes(); |
| 45 | 47 |
| 46 // The unique signature for this form, composed of the target url domain, | 48 // The unique signature for this form, composed of the target url domain, |
| 47 // the form name, and the form field names in a 64-bit hash. | 49 // the form name, and the form field names in a 64-bit hash. |
| 48 std::string FormSignature() const; | 50 std::string FormSignature() const; |
| 49 | 51 |
| 50 // Runs a quick heuristic to rule out pages but obviously not auto-fillable, | 52 // Runs a quick heuristic to rule out pages but obviously not auto-fillable, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // The names of the form input elements, that are part of the form signature. | 95 // The names of the form input elements, that are part of the form signature. |
| 94 // The string starts with "&" and the names are also separated by the "&" | 96 // The string starts with "&" and the names are also separated by the "&" |
| 95 // character. E.g.: "&form_input1_name&form_input2_name&...&form_inputN_name" | 97 // character. E.g.: "&form_input1_name&form_input2_name&...&form_inputN_name" |
| 96 std::string form_signature_field_names_; | 98 std::string form_signature_field_names_; |
| 97 | 99 |
| 98 // GET or POST. | 100 // GET or POST. |
| 99 RequestMethod method_; | 101 RequestMethod method_; |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ | 104 #endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_ |
| OLD | NEW |