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

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

Issue 2148303005: [Password Generation] Sends the flag whether a field has nonempty user input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a typo Created 4 years, 5 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 e01fdd1f119f96351e46c2d454fb551f2a811439..451249cd4404f67a95cf84e909005bb771eff0d5 100644
--- a/components/autofill/core/common/form_field_data.h
+++ b/components/autofill/core/common/form_field_data.h
@@ -19,6 +19,20 @@ class PickleIterator;
namespace autofill {
+// The flags describing form field properties.
+enum FieldPropertiesFlags {
+ NO_FLAGS = 0u,
+ USER_TYPED = 1u << 0,
+ AUTOFILLED = 1u << 1,
+ HAD_FOCUS = 1u << 2,
+ // Use this flag, if some error occurred in flags processing.
+ ERROR_OCCURRED = 1u << 3
+};
+
+// FieldPropertiesMask is used to contain combinations of FieldPropertiesFlags
+// values.
+typedef uint32_t FieldPropertiesMask;
+
// Stores information about a field in a form.
struct FormFieldData {
// Copied to components/autofill/ios/browser/resources/autofill_controller.js.
@@ -71,6 +85,7 @@ struct FormFieldData {
bool should_autocomplete;
RoleAttribute role;
base::i18n::TextDirection text_direction;
+ FieldPropertiesMask properties_mask;
// For the HTML snippet |<option value="US">United States</option>|, the
// value is "US" and the contents are "United States".
@@ -108,6 +123,7 @@ void SetCheckStatus(FormFieldData* form_field_data,
EXPECT_EQ(expected.css_classes, actual.css_classes); \
EXPECT_EQ(expected.is_autofilled, actual.is_autofilled); \
EXPECT_EQ(expected.check_status, actual.check_status); \
+ EXPECT_EQ(expected.properties_mask, actual.properties_mask); \
} while (0)
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698