| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 FormStructure(const FormData& form, | 58 FormStructure(const FormData& form, |
| 59 const std::string& autocheckout_url_prefix); | 59 const std::string& autocheckout_url_prefix); |
| 60 virtual ~FormStructure(); | 60 virtual ~FormStructure(); |
| 61 | 61 |
| 62 // Runs several heuristics against the form fields to determine their possible | 62 // Runs several heuristics against the form fields to determine their possible |
| 63 // types. | 63 // types. |
| 64 void DetermineHeuristicTypes(const AutofillMetrics& metric_logger); | 64 void DetermineHeuristicTypes(const AutofillMetrics& metric_logger); |
| 65 | 65 |
| 66 // Encodes the XML upload request from this FormStructure. | 66 // Encodes the XML upload request from this FormStructure. |
| 67 bool EncodeUploadRequest(const FieldTypeSet& available_field_types, | 67 bool EncodeUploadRequest(const ServerFieldTypeSet& available_field_types, |
| 68 bool form_was_autofilled, | 68 bool form_was_autofilled, |
| 69 std::string* encoded_xml) const; | 69 std::string* encoded_xml) const; |
| 70 | 70 |
| 71 // Encodes a XML block contains autofill field type from this FormStructure. | 71 // Encodes a XML block contains autofill field type from this FormStructure. |
| 72 // This XML will be written VLOG only, never be sent to server. It will | 72 // This XML will be written VLOG only, never be sent to server. It will |
| 73 // help make FieldAssignments and feed back to autofill server as | 73 // help make FieldAssignments and feed back to autofill server as |
| 74 // experiment data. | 74 // experiment data. |
| 75 bool EncodeFieldAssignments(const FieldTypeSet& available_field_types, | 75 bool EncodeFieldAssignments(const ServerFieldTypeSet& available_field_types, |
| 76 std::string* encoded_xml) const; | 76 std::string* encoded_xml) const; |
| 77 | 77 |
| 78 // Encodes the XML query request for the set of forms. | 78 // Encodes the XML query request for the set of forms. |
| 79 // All fields are returned in one XML. For example, there are three forms, | 79 // All fields are returned in one XML. For example, there are three forms, |
| 80 // with 2, 4, and 3 fields. The returned XML would have type info for 9 | 80 // with 2, 4, and 3 fields. The returned XML would have type info for 9 |
| 81 // fields, first two of which would be for the first form, next 4 for the | 81 // fields, first two of which would be for the first form, next 4 for the |
| 82 // second, and the rest is for the third. | 82 // second, and the rest is for the third. |
| 83 static bool EncodeQueryRequest(const std::vector<FormStructure*>& forms, | 83 static bool EncodeQueryRequest(const std::vector<FormStructure*>& forms, |
| 84 std::vector<std::string>* encoded_signatures, | 84 std::vector<std::string>* encoded_signatures, |
| 85 std::string* encoded_xml); | 85 std::string* encoded_xml); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 // Whether or not this form was filled by Autocheckout. | 264 // Whether or not this form was filled by Autocheckout. |
| 265 bool filled_by_autocheckout_; | 265 bool filled_by_autocheckout_; |
| 266 | 266 |
| 267 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 267 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 } // namespace autofill | 270 } // namespace autofill |
| 271 | 271 |
| 272 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 272 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| OLD | NEW |