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

Unified Diff: components/autofill/core/common/autofill_util.cc

Issue 2318533002: [Password Generation] Use signatures for form matching (Closed)
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « components/autofill/core/common/autofill_util.h ('k') | components/autofill/core/common/form_field_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/common/autofill_util.cc
diff --git a/components/autofill/core/common/autofill_util.cc b/components/autofill/core/common/autofill_util.cc
index 28fc6c5e37cdfcf9ae714cffa0948f8b985f659f..faf019e8cdbecb36a56069c90ca5113bf30f1746 100644
--- a/components/autofill/core/common/autofill_util.cc
+++ b/components/autofill/core/common/autofill_util.cc
@@ -105,4 +105,31 @@ bool IsDesktopPlatform() {
#endif
}
+bool ShouldSkipField(const FormFieldData& field) {
+ return IsCheckable(field.check_status);
+}
+
+bool IsCheckable(const FormFieldData::CheckStatus& check_status) {
+ return check_status != FormFieldData::CheckStatus::NOT_CHECKABLE;
+}
+
+bool IsChecked(const FormFieldData::CheckStatus& check_status) {
+ return check_status == FormFieldData::CheckStatus::CHECKED;
+}
+
+void SetCheckStatus(FormFieldData* form_field_data,
+ bool isCheckable,
+ bool isChecked) {
+ if (isChecked) {
+ form_field_data->check_status = FormFieldData::CheckStatus::CHECKED;
+ } else {
+ if (isCheckable) {
+ form_field_data->check_status =
+ FormFieldData::CheckStatus::CHECKABLE_BUT_UNCHECKED;
+ } else {
+ form_field_data->check_status = FormFieldData::CheckStatus::NOT_CHECKABLE;
+ }
+ }
+}
+
} // namespace autofill
« no previous file with comments | « components/autofill/core/common/autofill_util.h ('k') | components/autofill/core/common/form_field_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698