| 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 14 matching lines...) Expand all Loading... |
| 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 // The URL (minus query parameters) containing the form. | 31 // The URL (minus query parameters) containing the form. |
| 32 GURL origin; | 32 GURL origin; |
| 33 // The action target of the form. | 33 // The action target of the form. |
| 34 GURL action; | 34 GURL action; |
| 35 // true if this form is a form tag. | 35 // True if this form is a form tag. |
| 36 bool is_form_tag; | 36 bool is_form_tag; |
| 37 // True if the form is made of unowned fields in a non checkout flow. |
| 38 bool is_formless_checkout; |
| 37 // A vector of all the input fields in the form. | 39 // A vector of all the input fields in the form. |
| 38 std::vector<FormFieldData> fields; | 40 std::vector<FormFieldData> fields; |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 // For testing. | 43 // For testing. |
| 42 std::ostream& operator<<(std::ostream& os, const FormData& form); | 44 std::ostream& operator<<(std::ostream& os, const FormData& form); |
| 43 | 45 |
| 44 // Serialize FormData. Used by the PasswordManager to persist FormData | 46 // Serialize FormData. Used by the PasswordManager to persist FormData |
| 45 // pertaining to password forms. Serialized data is appended to |pickle|. | 47 // pertaining to password forms. Serialized data is appended to |pickle|. |
| 46 void SerializeFormData(const FormData& form_data, base::Pickle* pickle); | 48 void SerializeFormData(const FormData& form_data, base::Pickle* pickle); |
| 47 // Deserialize FormData. This assumes that |iter| is currently pointing to | 49 // Deserialize FormData. This assumes that |iter| is currently pointing to |
| 48 // the part of a pickle created by SerializeFormData. Returns true on success. | 50 // the part of a pickle created by SerializeFormData. Returns true on success. |
| 49 bool DeserializeFormData(base::PickleIterator* iter, FormData* form_data); | 51 bool DeserializeFormData(base::PickleIterator* iter, FormData* form_data); |
| 50 | 52 |
| 51 // Serialize FormData. Used by the PasswordManager to persist FormData | 53 // Serialize FormData. Used by the PasswordManager to persist FormData |
| 52 // pertaining to password forms in base64 string. It is useful since in some | 54 // pertaining to password forms in base64 string. It is useful since in some |
| 53 // cases we need to store C strings without embedded '\0' symbols. | 55 // cases we need to store C strings without embedded '\0' symbols. |
| 54 void SerializeFormDataToBase64String(const FormData& form_data, | 56 void SerializeFormDataToBase64String(const FormData& form_data, |
| 55 std::string* output); | 57 std::string* output); |
| 56 // Deserialize FormData. Returns true on success. | 58 // Deserialize FormData. Returns true on success. |
| 57 bool DeserializeFormDataFromBase64String(const base::StringPiece& input, | 59 bool DeserializeFormDataFromBase64String(const base::StringPiece& input, |
| 58 FormData* form_data); | 60 FormData* form_data); |
| 59 | 61 |
| 60 } // namespace autofill | 62 } // namespace autofill |
| 61 | 63 |
| 62 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ | 64 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ |
| OLD | NEW |