Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: components/autofill/core/common/form_field_data.h

Issue 2022123002: Merge autofill::FormFieldData::is_checkable and is_checked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/common/form_field_data.h
diff --git a/components/autofill/core/common/form_field_data.h b/components/autofill/core/common/form_field_data.h
index 5a9bb8a89356c48dba81b25d492b3836333a9d39..b49e4519b4cb28f31273022c2b96ee3a727a817d 100644
--- a/components/autofill/core/common/form_field_data.h
+++ b/components/autofill/core/common/form_field_data.h
@@ -29,6 +29,12 @@ struct FormFieldData {
ROLE_ATTRIBUTE_OTHER,
};
+ enum CheckStatus {
+ NOT_CHECKABLE,
+ CHECKABLE_BUT_UNCHECKED,
+ CHECKED,
+ };
+
FormFieldData();
FormFieldData(const FormFieldData& other);
~FormFieldData();
@@ -53,8 +59,7 @@ struct FormFieldData {
// (base::Pickle used to serialize that as 64 bit).
uint64_t max_length;
bool is_autofilled;
- bool is_checked;
- bool is_checkable;
+ CheckStatus check_status;
bool is_focusable;
bool should_autocomplete;
RoleAttribute role;
@@ -76,6 +81,12 @@ bool DeserializeFormFieldData(base::PickleIterator* pickle_iterator,
// So we can compare FormFieldDatas with EXPECT_EQ().
std::ostream& operator<<(std::ostream& os, const FormFieldData& field);
+bool IsCheckable(const FormFieldData::CheckStatus& check_status);
+bool IsChecked(const FormFieldData::CheckStatus& check_status);
+void SetCheckStatus(FormFieldData* form_field_data,
+ bool isCheckable,
+ bool isChecked);
+
// Prefer to use this macro in place of |EXPECT_EQ()| for comparing
// |FormFieldData|s in test code.
#define EXPECT_FORM_FIELD_DATA_EQUALS(expected, actual) \
@@ -88,8 +99,7 @@ std::ostream& operator<<(std::ostream& os, const FormFieldData& field);
EXPECT_EQ(expected.placeholder, actual.placeholder); \
EXPECT_EQ(expected.max_length, actual.max_length); \
EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \
- EXPECT_EQ(expected.is_checked, actual.is_checked); \
- EXPECT_EQ(expected.is_checkable, actual.is_checkable); \
+ EXPECT_EQ(expected.check_status, actual.check_status); \
} while (0)
} // namespace autofill
« no previous file with comments | « components/autofill/core/common/form_data_unittest.cc ('k') | components/autofill/core/common/form_field_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698