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

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

Issue 1110833002: [autofill] Sync server card and address metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Class comment and one more expectation in test. Created 5 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
Index: components/autofill/core/browser/webdata/autofill_change.h
diff --git a/components/autofill/core/browser/webdata/autofill_change.h b/components/autofill/core/browser/webdata/autofill_change.h
index 0e856570f94d66efa173cfb37dacb385df5051eb..80281f5bd636f73bd1faf644b03d641b2e8965bf 100644
--- a/components/autofill/core/browser/webdata/autofill_change.h
+++ b/components/autofill/core/browser/webdata/autofill_change.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_CHANGE_H__
#define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_CHANGE_H__
+#include <string>
#include <vector>
#include "components/autofill/core/browser/webdata/autofill_entry.h"
@@ -12,9 +13,10 @@
namespace autofill {
class AutofillProfile;
+class CreditCard;
// For classic Autofill form fields, the KeyType is AutofillKey.
-// Autofill++ types such as AutofillProfile and CreditCard simply use an int.
+// Autofill++ types such as AutofillProfile and CreditCard simply use a string.
template <typename KeyType>
class GenericAutofillChange {
public:
@@ -70,6 +72,25 @@ class AutofillProfileChange : public GenericAutofillChange<std::string> {
const AutofillProfile* profile_;
};
+// Change notification details for credit card changes.
+class CreditCardChange : public GenericAutofillChange<std::string> {
+ public:
+ // The |type| input specifies the change type. The |key| input is the key,
+ // which is expected to be the GUID identifying the |card|.
+ // When |type| == ADD, |card| should be non-NULL.
+ // When |type| == UPDATE, |card| should be non-NULL.
+ // When |type| == REMOVE, |card| should be NULL.
+ CreditCardChange(Type type, const std::string& key, const CreditCard* card);
+ ~CreditCardChange() override;
+
+ const CreditCard* card() const { return card_; }
+ bool operator==(const CreditCardChange& change) const;
+
+ private:
+ // Weak reference, can be NULL.
+ const CreditCard* card_;
+};
+
} // namespace autofill
#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_CHANGE_H__
« no previous file with comments | « components/autofill/core/browser/BUILD.gn ('k') | components/autofill/core/browser/webdata/autofill_change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698