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" |
| 11 #include "components/autofill/core/common/form_field_data.h" | 11 #include "components/autofill/core/common/form_field_data.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace autofill { | 14 namespace autofill { |
| 15 | 15 |
| 16 // Holds information about a form to be filled and/or submitted. | 16 // Holds information about a form to be filled and/or submitted. |
| 17 struct FormData { | 17 struct FormData { |
| 18 FormData(); | 18 FormData(); |
| 19 FormData(const FormData& data); | 19 FormData(const FormData& data); |
| 20 ~FormData(); | 20 ~FormData(); |
| 21 | 21 |
| 22 // Returns true if two forms are the same, not counting the values of the | 22 // Returns true if two forms are the same, not counting the values of the |
| 23 // form elements. | 23 // form elements. |
| 24 bool SameFormAs(const FormData& other) const; | 24 bool SameFormAs(const FormData& other) const; |
| 25 | 25 |
| 26 // Same as SameFormAs() except calling FormFieldData.SimilarFieldAs() to | |
| 27 // comparing fields, so we know forms are similar enough to be considered as | |
|
sebsg
2017/05/08 15:38:17
comparing -> compare. Also I feel like what's afte
michaelbai
2017/05/09 00:27:03
Done.
| |
| 28 // same for autofill purpose. | |
| 29 bool SimilarFormAs(const FormData& other) const; | |
| 30 | |
| 26 // Note: operator==() performs a full-field-comparison(byte by byte), this is | 31 // Note: operator==() performs a full-field-comparison(byte by byte), this is |
| 27 // different from SameFormAs(), which ignores comparison for those "values" of | 32 // different from SameFormAs(), which ignores comparison for those "values" of |
| 28 // all form fields, just like what FormFieldData::SameFieldAs() ignores. | 33 // all form fields, just like what FormFieldData::SameFieldAs() ignores. |
| 29 bool operator==(const FormData& form) const; | 34 bool operator==(const FormData& form) const; |
| 30 bool operator!=(const FormData& form) const; | 35 bool operator!=(const FormData& form) const; |
| 31 // Allow FormData to be a key in STL containers. | 36 // Allow FormData to be a key in STL containers. |
| 32 bool operator<(const FormData& form) const; | 37 bool operator<(const FormData& form) const; |
| 33 | 38 |
| 34 // The name of the form. | 39 // The name of the form. |
| 35 base::string16 name; | 40 base::string16 name; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 60 // cases we need to store C strings without embedded '\0' symbols. | 65 // cases we need to store C strings without embedded '\0' symbols. |
| 61 void SerializeFormDataToBase64String(const FormData& form_data, | 66 void SerializeFormDataToBase64String(const FormData& form_data, |
| 62 std::string* output); | 67 std::string* output); |
| 63 // Deserialize FormData. Returns true on success. | 68 // Deserialize FormData. Returns true on success. |
| 64 bool DeserializeFormDataFromBase64String(const base::StringPiece& input, | 69 bool DeserializeFormDataFromBase64String(const base::StringPiece& input, |
| 65 FormData* form_data); | 70 FormData* form_data); |
| 66 | 71 |
| 67 } // namespace autofill | 72 } // namespace autofill |
| 68 | 73 |
| 69 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ | 74 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_H_ |
| OLD | NEW |