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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H__
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H__
10 #include "base/strings/string16.h"
11 #include "components/autofill/core/common/form_field_data.h"
16 // Holds information about a form to be filled and/or submitted.
19 FormData(const FormData& data);
23 bool operator==(const FormData& form) const;
24 bool operator!=(const FormData& form) const;
26 // The name of the form.
29 base::string16 method;
30 // The URL (minus query parameters) containing the form.
32 // The action target of the form.
34 // true if this form was submitted by a user gesture and not javascript.
36 // A vector of all the input fields in the form.
37 std::vector<FormFieldData> fields;
41 std::ostream& operator<<(std::ostream& os, const FormData& form);
43 // Serialize FormData. Used by the PasswordManager to persist FormData
44 // pertaining to password forms. Serialized data is appended to |pickle|
45 void SerializeFormData(const FormData& form_data, Pickle* pickle);
46 // Deserialize FormData. This assumes that |iter| is currently pointing to
47 // the part of a pickle created by SerializeFormData. Returns true on success.
48 bool DeserializeFormData(PickleIterator* iter, FormData* form_data);
50 } // namespace autofill
52 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H__