Implement OCSP stapling in Windows BoringSSL port.
[chromium-blink-merge.git] / components / autofill / core / common / form_data.h
blobffbc204b61bc864b2571619bbf780db71c57c21a
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_
8 #include <vector>
10 #include "base/strings/string16.h"
11 #include "components/autofill/core/common/form_field_data.h"
12 #include "url/gurl.h"
14 namespace autofill {
16 // Holds information about a form to be filled and/or submitted.
17 struct FormData {
18 FormData();
19 FormData(const FormData& data);
20 ~FormData();
22 // Used in testing, and in recording metrics and setting preferences, where
23 // false positives/negatives aren't super important.
24 bool operator==(const FormData& form) const;
25 bool operator!=(const FormData& form) const;
27 // Allow FormData to be a key in STL containers.
28 bool operator<(const FormData& form) const;
30 // The name of the form.
31 base::string16 name;
32 // The URL (minus query parameters) containing the form.
33 GURL origin;
34 // The action target of the form.
35 GURL action;
36 // true if this form was submitted by a user gesture and not javascript.
37 bool user_submitted;
38 // A vector of all the input fields in the form.
39 std::vector<FormFieldData> fields;
42 // For testing.
43 std::ostream& operator<<(std::ostream& os, const FormData& form);
45 // Serialize FormData. Used by the PasswordManager to persist FormData
46 // pertaining to password forms. Serialized data is appended to |pickle|
47 void SerializeFormData(const FormData& form_data, Pickle* pickle);
48 // Deserialize FormData. This assumes that |iter| is currently pointing to
49 // the part of a pickle created by SerializeFormData. Returns true on success.
50 bool DeserializeFormData(PickleIterator* iter, FormData* form_data);
52 } // namespace autofill
54 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_