Chromium Code Reviews| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 64 |
| 65 // Encodes a XML block contains autofill field type from this FormStructure. | 65 // Encodes a XML block contains autofill field type from this FormStructure. |
| 66 // This XML will be written VLOG only, never be sent to server. It will | 66 // This XML will be written VLOG only, never be sent to server. It will |
| 67 // help make FieldAssignments and feed back to autofill server as | 67 // help make FieldAssignments and feed back to autofill server as |
| 68 // experiment data. | 68 // experiment data. |
| 69 bool EncodeFieldAssignments(const ServerFieldTypeSet& available_field_types, | 69 bool EncodeFieldAssignments(const ServerFieldTypeSet& available_field_types, |
| 70 std::string* encoded_xml) const; | 70 std::string* encoded_xml) const; |
| 71 | 71 |
| 72 // Encodes the XML query request for the set of |forms| that are valid (see | 72 // Encodes the XML query request for the set of |forms| that are valid (see |
| 73 // implementation for details on which forms are not included in the query). | 73 // implementation for details on which forms are not included in the query). |
| 74 // The forms and form signatures used in the Query request are output in | 74 // The form signatures used in the Query request are output in |
| 75 // |queried_forms| and |encoded_signatures|, respectively. All valid fields | 75 // |encoded_signatures|, respectively. All valid fields are encoded in |
|
vabr (Chromium)
2015/11/19 07:56:04
nit: No need for 'respectively' any more.
Mathieu
2015/11/19 13:20:55
Done.
| |
| 76 // are encoded in |encoded_xml|. For example, there are three valid forms, | 76 // |encoded_xml|. For example, there are three valid forms, with 2, 4, and 3 |
| 77 // with 2, 4, and 3 fields. The returned XML would have type info for 9 | 77 // fields. The returned XML would have type info for 9 fields, first two of |
| 78 // fields, first two of which would be for the first form, next 4 for the | 78 // which would be for the first form, next 4 for the second, and the rest is |
| 79 // second, and the rest is for the third. | 79 // for the third. |
| 80 static bool EncodeQueryRequest(const std::vector<FormStructure*>& forms, | 80 static bool EncodeQueryRequest(const std::vector<FormStructure*>& forms, |
| 81 std::vector<std::string>* encoded_signatures, | 81 std::vector<std::string>* encoded_signatures, |
| 82 std::vector<FormStructure*>* queried_forms, | |
| 83 std::string* encoded_xml); | 82 std::string* encoded_xml); |
| 84 | 83 |
| 85 // Parses the field types from the server query response. |forms| must be the | 84 // Parses the field types from the server query response. |forms| must be the |
| 86 // same as the one passed to EncodeQueryRequest when constructing the query. | 85 // same as the one passed to EncodeQueryRequest when constructing the query. |
| 87 // |rappor_service| may be null. | 86 // |rappor_service| may be null. |
| 88 static void ParseQueryResponse(const std::string& response_xml, | 87 static void ParseQueryResponse(const std::string& response_xml, |
| 89 const std::vector<FormStructure*>& forms, | 88 const std::vector<FormStructure*>& forms, |
| 90 rappor::RapporService* rappor_service); | 89 rappor::RapporService* rappor_service); |
| 91 | 90 |
| 92 // Returns predictions using the details from the given |form_structures| and | 91 // Returns predictions using the details from the given |form_structures| and |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 | 272 |
| 274 // True if the form is a <form>. | 273 // True if the form is a <form>. |
| 275 bool is_form_tag_; | 274 bool is_form_tag_; |
| 276 | 275 |
| 277 DISALLOW_COPY_AND_ASSIGN(FormStructure); | 276 DISALLOW_COPY_AND_ASSIGN(FormStructure); |
| 278 }; | 277 }; |
| 279 | 278 |
| 280 } // namespace autofill | 279 } // namespace autofill |
| 281 | 280 |
| 282 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ | 281 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| OLD | NEW |