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

Unified Diff: components/autofill/core/browser/webdata/autofill_change.cc

Issue 1110833002: [autofill] Sync server card and address metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work Created 5 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
Index: components/autofill/core/browser/webdata/autofill_change.cc
diff --git a/components/autofill/core/browser/webdata/autofill_change.cc b/components/autofill/core/browser/webdata/autofill_change.cc
index c02bdd8464d8476d974f1cfd0a04e2c60f55af10..c0922f7d469c26b3599f09150fb7b909fd7eadce 100644
--- a/components/autofill/core/browser/webdata/autofill_change.cc
+++ b/components/autofill/core/browser/webdata/autofill_change.cc
@@ -36,4 +36,22 @@ bool AutofillProfileChange::operator==(
(type() != REMOVE) ? *profile() == *change.profile() : true;
}
+CreditCardChange::CreditCardChange(Type type,
+ const std::string& key,
+ const CreditCard* card)
+ : GenericAutofillChange<std::string>(type, key), card_(card) {
+ DCHECK(type == ADD ? (card && card->guid() == key) : true);
+ DCHECK(type == UPDATE ? (card && card->guid() == key) : true);
+ DCHECK(type == REMOVE ? !card : true);
+}
+
+CreditCardChange::~CreditCardChange() {
+}
+
+bool CreditCardChange::operator==(const CreditCardChange& change) const {
+ return type() == change.type() && key() == change.key() && (type() != REMOVE)
+ ? *card() == *change.card()
+ : true;
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698