summaryrefslogtreecommitdiffstats
path: root/components/sync_driver
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-02-12 10:44:39 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-12 18:45:23 +0000
commit43eadb637fa97fda1785cf6ad0d4a471c025c06d (patch)
tree842fbc7024de585bb49882965d4d9abdd8d34b05 /components/sync_driver
parent25eff098c77343e5b95f25c4465a0eb09942ab6e (diff)
downloadchromium_src-43eadb637fa97fda1785cf6ad0d4a471c025c06d.zip
chromium_src-43eadb637fa97fda1785cf6ad0d4a471c025c06d.tar.gz
chromium_src-43eadb637fa97fda1785cf6ad0d4a471c025c06d.tar.bz2
Hook up wallet card and address sync
This syncs the masked credit card and addresses from wallet into Chrome autofill. R=estade, zea TBR=isherman (histograms) Review URL: https://codereview.chromium.org/902673002 Cr-Commit-Position: refs/heads/master@{#316008}
Diffstat (limited to 'components/sync_driver')
-rw-r--r--components/sync_driver/model_association_manager.cc1
-rw-r--r--components/sync_driver/pref_names.cc1
-rw-r--r--components/sync_driver/pref_names.h1
-rw-r--r--components/sync_driver/sync_prefs.cc4
-rw-r--r--components/sync_driver/sync_prefs_unittest.cc1
5 files changed, 8 insertions, 0 deletions
diff --git a/components/sync_driver/model_association_manager.cc b/components/sync_driver/model_association_manager.cc
index 5c2d223..71fbdd5 100644
--- a/components/sync_driver/model_association_manager.cc
+++ b/components/sync_driver/model_association_manager.cc
@@ -30,6 +30,7 @@ static const syncer::ModelType kStartOrder[] = {
syncer::PASSWORDS,
syncer::AUTOFILL,
syncer::AUTOFILL_PROFILE,
+ syncer::AUTOFILL_WALLET_DATA,
syncer::EXTENSION_SETTINGS,
syncer::APP_SETTINGS,
syncer::TYPED_URLS,
diff --git a/components/sync_driver/pref_names.cc b/components/sync_driver/pref_names.cc
index 6ad3763..d4f04d37 100644
--- a/components/sync_driver/pref_names.cc
+++ b/components/sync_driver/pref_names.cc
@@ -36,6 +36,7 @@ const char kSyncAppSettings[] = "sync.app_settings";
const char kSyncApps[] = "sync.apps";
const char kSyncArticles[] = "sync.articles";
const char kSyncAutofillProfile[] = "sync.autofill_profile";
+const char kSyncAutofillWallet[] = "sync.autofill_wallet";
const char kSyncAutofill[] = "sync.autofill";
const char kSyncBookmarks[] = "sync.bookmarks";
const char kSyncDeviceInfo[] = "sync.device_info";
diff --git a/components/sync_driver/pref_names.h b/components/sync_driver/pref_names.h
index 6d77b98..31a605a 100644
--- a/components/sync_driver/pref_names.h
+++ b/components/sync_driver/pref_names.h
@@ -24,6 +24,7 @@ extern const char kSyncAppSettings[];
extern const char kSyncApps[];
extern const char kSyncArticles[];
extern const char kSyncAutofillProfile[];
+extern const char kSyncAutofillWallet[];
extern const char kSyncAutofill[];
extern const char kSyncBookmarks[];
extern const char kSyncDeviceInfo[];
diff --git a/components/sync_driver/sync_prefs.cc b/components/sync_driver/sync_prefs.cc
index e8c3f19..23ccbbf 100644
--- a/components/sync_driver/sync_prefs.cc
+++ b/components/sync_driver/sync_prefs.cc
@@ -129,6 +129,7 @@ void SyncPrefs::RegisterProfilePrefs(
model_set.Put(syncer::PREFERENCES);
model_set.Put(syncer::PASSWORDS);
model_set.Put(syncer::AUTOFILL_PROFILE);
+ model_set.Put(syncer::AUTOFILL_WALLET_DATA);
model_set.Put(syncer::AUTOFILL);
model_set.Put(syncer::THEMES);
model_set.Put(syncer::EXTENSIONS);
@@ -299,6 +300,8 @@ const char* SyncPrefs::GetPrefNameForDataType(syncer::ModelType data_type) {
case syncer::AUTOFILL:
return prefs::kSyncAutofill;
case syncer::AUTOFILL_PROFILE:
+ return prefs::kSyncAutofillWallet;
+ case syncer::AUTOFILL_WALLET_DATA:
return prefs::kSyncAutofillProfile;
case syncer::THEMES:
return prefs::kSyncThemes;
@@ -415,6 +418,7 @@ void SyncPrefs::RegisterPrefGroups() {
pref_groups_[syncer::APPS].Put(syncer::APP_LIST);
pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE);
+ pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_WALLET_DATA);
pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS);
diff --git a/components/sync_driver/sync_prefs_unittest.cc b/components/sync_driver/sync_prefs_unittest.cc
index 8380dba..b1f3423 100644
--- a/components/sync_driver/sync_prefs_unittest.cc
+++ b/components/sync_driver/sync_prefs_unittest.cc
@@ -140,6 +140,7 @@ TEST_F(SyncPrefsTest, PreferredTypesNotKeepEverythingSynced) {
syncer::ModelTypeSet expected_preferred_types(preferred_types);
if (it.Get() == syncer::AUTOFILL) {
expected_preferred_types.Put(syncer::AUTOFILL_PROFILE);
+ expected_preferred_types.Put(syncer::AUTOFILL_WALLET_DATA);
}
if (it.Get() == syncer::PREFERENCES) {
expected_preferred_types.Put(syncer::DICTIONARY);