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_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 17 matching lines...) Expand all Loading... | |
| 28 bool operator<(const FormData& form) const; | 28 bool operator<(const FormData& form) const; |
| 29 | 29 |
| 30 // The name of the form. | 30 // The name of the form. |
| 31 base::string16 name; | 31 base::string16 name; |
| 32 // The URL (minus query parameters) containing the form. | 32 // The URL (minus query parameters) containing the form. |
| 33 GURL origin; | 33 GURL origin; |
| 34 // The action target of the form. | 34 // The action target of the form. |
| 35 GURL action; | 35 GURL action; |
| 36 // true if this form was submitted by a user gesture and not javascript. | 36 // true if this form was submitted by a user gesture and not javascript. |
| 37 bool user_submitted; | 37 bool user_submitted; |
| 38 | |
| 39 // Password form input fields. | |
| 40 FormFieldData username; | |
| 41 FormFieldData password; | |
| 42 | |
| 43 // TODO (pritam.nikam): Make sure we remove |fields|, and add form fields | |
|
vabr (Chromium)
2014/09/30 14:19:49
The action described in TODO should be part of thi
Pritam Nikam
2014/10/13 10:48:00
Seems, completely removing |fields| will take some
Ilya Sherman
2014/10/13 23:49:32
It sounds like we're using this class both for Aut
| |
| 44 // for all possible autofillable input fields. | |
| 45 | |
| 38 // A vector of all the input fields in the form. | 46 // A vector of all the input fields in the form. |
| 39 std::vector<FormFieldData> fields; | 47 std::vector<FormFieldData> fields; |
| 40 }; | 48 }; |
| 41 | 49 |
| 42 // For testing. | 50 // For testing. |
| 43 std::ostream& operator<<(std::ostream& os, const FormData& form); | 51 std::ostream& operator<<(std::ostream& os, const FormData& form); |
| 44 | 52 |
| 45 // Serialize FormData. Used by the PasswordManager to persist FormData | 53 // Serialize FormData. Used by the PasswordManager to persist FormData |
| 46 // pertaining to password forms. Serialized data is appended to |pickle| | 54 // pertaining to password forms. Serialized data is appended to |pickle| |
| 47 void SerializeFormData(const FormData& form_data, Pickle* pickle); | 55 void SerializeFormData(const FormData& form_data, Pickle* pickle); |
| 48 // Deserialize FormData. This assumes that |iter| is currently pointing to | 56 // Deserialize FormData. This assumes that |iter| is currently pointing to |
| 49 // the part of a pickle created by SerializeFormData. Returns true on success. | 57 // the part of a pickle created by SerializeFormData. Returns true on success. |
| 50 bool DeserializeFormData(PickleIterator* iter, FormData* form_data); | 58 bool DeserializeFormData(PickleIterator* iter, FormData* form_data); |
| 51 | 59 |
| 52 } // namespace autofill | 60 } // namespace autofill |
| 53 | 61 |
| 54 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ | 62 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ |
| OLD | NEW |