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_COMMON_FORM_DATA_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Used in testing. | 22 // Used in testing. |
23 bool operator==(const FormData& form) const; | 23 bool operator==(const FormData& form) const; |
24 bool operator!=(const FormData& form) const; | 24 bool operator!=(const FormData& form) const; |
25 | 25 |
26 // Allow FormData to be a key in STL containers. | 26 // Allow FormData to be a key in STL containers. |
27 bool operator<(const FormData& form) const; | 27 bool operator<(const FormData& form) const; |
28 | 28 |
29 // The name of the form. | 29 // The name of the form. |
30 base::string16 name; | 30 base::string16 name; |
31 // GET or POST. | |
32 base::string16 method; | |
33 // The URL (minus query parameters) containing the form. | 31 // The URL (minus query parameters) containing the form. |
34 GURL origin; | 32 GURL origin; |
35 // The action target of the form. | 33 // The action target of the form. |
36 GURL action; | 34 GURL action; |
37 // true if this form was submitted by a user gesture and not javascript. | 35 // true if this form was submitted by a user gesture and not javascript. |
38 bool user_submitted; | 36 bool user_submitted; |
39 // A vector of all the input fields in the form. | 37 // A vector of all the input fields in the form. |
40 std::vector<FormFieldData> fields; | 38 std::vector<FormFieldData> fields; |
41 }; | 39 }; |
42 | 40 |
43 // For testing. | 41 // For testing. |
44 std::ostream& operator<<(std::ostream& os, const FormData& form); | 42 std::ostream& operator<<(std::ostream& os, const FormData& form); |
45 | 43 |
46 // Serialize FormData. Used by the PasswordManager to persist FormData | 44 // Serialize FormData. Used by the PasswordManager to persist FormData |
47 // pertaining to password forms. Serialized data is appended to |pickle| | 45 // pertaining to password forms. Serialized data is appended to |pickle| |
48 void SerializeFormData(const FormData& form_data, Pickle* pickle); | 46 void SerializeFormData(const FormData& form_data, Pickle* pickle); |
49 // Deserialize FormData. This assumes that |iter| is currently pointing to | 47 // Deserialize FormData. This assumes that |iter| is currently pointing to |
50 // the part of a pickle created by SerializeFormData. Returns true on success. | 48 // the part of a pickle created by SerializeFormData. Returns true on success. |
51 bool DeserializeFormData(PickleIterator* iter, FormData* form_data); | 49 bool DeserializeFormData(PickleIterator* iter, FormData* form_data); |
52 | 50 |
53 } // namespace autofill | 51 } // namespace autofill |
54 | 52 |
55 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ | 53 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ |
OLD | NEW |