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

Unified Diff: components/sync_driver/sync_prefs.cc

Issue 694903002: [Sync] Device info should be enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 6 years, 2 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/sync_driver/sync_prefs.cc
diff --git a/components/sync_driver/sync_prefs.cc b/components/sync_driver/sync_prefs.cc
index 5773f0f4b217246bd10a69fe0b42cb3d1368c622..b5159dd1a0930b7e3eef6d11efbfdd57e0b8a1ff 100644
--- a/components/sync_driver/sync_prefs.cc
+++ b/components/sync_driver/sync_prefs.cc
@@ -66,9 +66,11 @@ void SyncPrefs::RegisterProfilePrefs(
// although they don't have sync representations.
user_types.PutAll(syncer::ProxyTypes());
- // Treat bookmarks specially.
+ // Treat bookmarks and device info specially.
RegisterDataTypePreferredPref(registry, syncer::BOOKMARKS, true);
+ RegisterDataTypePreferredPref(registry, syncer::DEVICE_INFO, true);
user_types.Remove(syncer::BOOKMARKS);
+ user_types.Remove(syncer::DEVICE_INFO);
// These two prefs are set from sync experiment to enable enhanced bookmarks.
registry->RegisterIntegerPref(
@@ -349,7 +351,7 @@ const char* SyncPrefs::GetPrefNameForDataType(syncer::ModelType data_type) {
default:
break;
}
- NOTREACHED();
+ NOTREACHED() << "Type is " << data_type;
return NULL;
}
@@ -454,6 +456,11 @@ bool SyncPrefs::GetDataTypePreferred(syncer::ModelType type) const {
NOTREACHED();
return false;
}
+
+ // Device info is always enabled.
+ if (pref_name == prefs::kSyncDeviceInfo)
+ return true;
+
if (type == syncer::PROXY_TABS &&
pref_service_->GetUserPrefValue(pref_name) == NULL &&
pref_service_->IsUserModifiablePreference(pref_name)) {
@@ -473,6 +480,11 @@ void SyncPrefs::SetDataTypePreferred(syncer::ModelType type,
NOTREACHED();
return;
}
+
+ // Device info is always preferred.
+ if (type == syncer::DEVICE_INFO)
+ return;
+
pref_service_->SetBoolean(pref_name, is_preferred);
}
« no previous file with comments | « chrome/browser/sync/test/integration/enable_disable_test.cc ('k') | components/sync_driver/sync_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698