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_FIELD_DATA_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Comparison operator exposed for STL map. Uses label, then name to sort. | 38 // Comparison operator exposed for STL map. Uses label, then name to sort. |
39 bool operator<(const FormFieldData& field) const; | 39 bool operator<(const FormFieldData& field) const; |
40 | 40 |
41 // If you add more, be sure to update the comparison operator, SameFieldAs, | 41 // If you add more, be sure to update the comparison operator, SameFieldAs, |
42 // serializing functions (in the .cc file) and the constructor. | 42 // serializing functions (in the .cc file) and the constructor. |
43 base::string16 label; | 43 base::string16 label; |
44 base::string16 name; | 44 base::string16 name; |
45 base::string16 value; | 45 base::string16 value; |
46 std::string form_control_type; | 46 std::string form_control_type; |
47 std::string autocomplete_attribute; | 47 std::string autocomplete_attribute; |
| 48 // Note: we use uint32_t instead of size_t because this struct is sent over |
| 49 // IPC which could span 32 & 64 bit processes. This is fine since the length |
| 50 // shouldn't exceed UINT32_MAX even on 64 bit builds. |
48 uint32_t max_length; | 51 uint32_t max_length; |
49 bool is_autofilled; | 52 bool is_autofilled; |
50 bool is_checked; | 53 bool is_checked; |
51 bool is_checkable; | 54 bool is_checkable; |
52 bool is_focusable; | 55 bool is_focusable; |
53 bool should_autocomplete; | 56 bool should_autocomplete; |
54 RoleAttribute role; | 57 RoleAttribute role; |
55 base::i18n::TextDirection text_direction; | 58 base::i18n::TextDirection text_direction; |
56 | 59 |
57 // For the HTML snippet |<option value="US">United States</option>|, the | 60 // For the HTML snippet |<option value="US">United States</option>|, the |
(...skipping 23 matching lines...) Expand all Loading... |
81 EXPECT_EQ(expected.autocomplete_attribute, actual.autocomplete_attribute); \ | 84 EXPECT_EQ(expected.autocomplete_attribute, actual.autocomplete_attribute); \ |
82 EXPECT_EQ(expected.max_length, actual.max_length); \ | 85 EXPECT_EQ(expected.max_length, actual.max_length); \ |
83 EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \ | 86 EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \ |
84 EXPECT_EQ(expected.is_checked, actual.is_checked); \ | 87 EXPECT_EQ(expected.is_checked, actual.is_checked); \ |
85 EXPECT_EQ(expected.is_checkable, actual.is_checkable); \ | 88 EXPECT_EQ(expected.is_checkable, actual.is_checkable); \ |
86 } while (0) | 89 } while (0) |
87 | 90 |
88 } // namespace autofill | 91 } // namespace autofill |
89 | 92 |
90 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ | 93 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_FIELD_DATA_H_ |
OLD | NEW |