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

Unified Diff: components/autofill/core/browser/contact_info.cc

Issue 2110563002: Use AutofillProfileComparator in place of ad-hoc merge logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge
Patch Set: Rebase 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
« no previous file with comments | « components/autofill/core/browser/contact_info.h ('k') | components/autofill/core/browser/form_group.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/contact_info.cc
diff --git a/components/autofill/core/browser/contact_info.cc b/components/autofill/core/browser/contact_info.cc
index 4953121726d749316ae081548d99b94a419b1994..352933661dbc4e23652c0c9791d925a5b25ad7fc 100644
--- a/components/autofill/core/browser/contact_info.cc
+++ b/components/autofill/core/browser/contact_info.cc
@@ -37,6 +37,13 @@ NameInfo& NameInfo::operator=(const NameInfo& info) {
return *this;
}
+bool NameInfo::operator==(const NameInfo& other) const {
+ if (this == &other)
+ return true;
+ return given_ == other.given_ && middle_ == other.middle_ &&
+ family_ == other.family_ && full_ == other.full_;
+}
+
bool NameInfo::ParsedNamesAreEqual(const NameInfo& info) const {
return given_ == info.given_ && middle_ == info.middle_ &&
family_ == info.family_;
@@ -199,6 +206,10 @@ EmailInfo& EmailInfo::operator=(const EmailInfo& info) {
return *this;
}
+bool EmailInfo::operator==(const EmailInfo& other) const {
+ return this == &other || email_ == other.email_;
+}
+
void EmailInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const {
supported_types->insert(EMAIL_ADDRESS);
}
@@ -231,6 +242,10 @@ CompanyInfo& CompanyInfo::operator=(const CompanyInfo& info) {
return *this;
}
+bool CompanyInfo::operator==(const CompanyInfo& other) const {
+ return this == &other || company_name_ == other.company_name_;
+}
+
void CompanyInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const {
supported_types->insert(COMPANY_NAME);
}
« no previous file with comments | « components/autofill/core/browser/contact_info.h ('k') | components/autofill/core/browser/form_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698