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

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

Issue 2745803003: autofill-try
Patch Set: autofill-try Created 3 years, 7 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/form_data.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/form_data.cc
diff --git a/components/autofill/core/common/form_data.cc b/components/autofill/core/common/form_data.cc
index 47137bb7f3b9c3d532e54ee33092efc2ddac4e12..81de550a22bd5ec38fe84685152880b2bccd2680 100644
--- a/components/autofill/core/common/form_data.cc
+++ b/components/autofill/core/common/form_data.cc
@@ -86,6 +86,19 @@ bool FormData::SameFormAs(const FormData& form) const {
return true;
}
+bool FormData::SimilarFormAs(const FormData& form) const {
+ if (name != form.name || origin != form.origin || action != form.action ||
+ is_form_tag != form.is_form_tag ||
+ is_formless_checkout != form.is_formless_checkout ||
+ fields.size() != form.fields.size())
+ return false;
+ for (size_t i = 0; i < fields.size(); ++i) {
+ if (!fields[i].SimilarFieldAs(form.fields[i]))
+ return false;
+ }
+ return true;
+}
+
bool FormData::operator==(const FormData& form) const {
return name == form.name && origin == form.origin && action == form.action &&
is_form_tag == form.is_form_tag &&
« no previous file with comments | « components/autofill/core/common/form_data.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