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

Unified Diff: chrome/browser/sync/sync_prefs.cc

Issue 12315053: Fix prefs registration in SyncPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 | « chrome/browser/sync/sync_prefs.h ('k') | chrome/browser/sync/sync_prefs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_prefs.cc
diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc
index 4a9f430829495a4e6fc92b4eacfc6c9174db01e8..3d9be89d17f64ea34649e32c0ccdfbeab0d73f30 100644
--- a/chrome/browser/sync/sync_prefs.cc
+++ b/chrome/browser/sync/sync_prefs.cc
@@ -43,8 +43,7 @@ SyncPrefs::~SyncPrefs() {
}
// static
-void SyncPrefs::RegisterUserPrefs(PrefService* prefs,
- PrefRegistrySyncable* registry) {
+void SyncPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) {
// TODO(joi): Remove |prefs| parameter.
registry->RegisterBooleanPref(prefs::kSyncHasSetupCompleted,
false,
@@ -56,18 +55,11 @@ void SyncPrefs::RegisterUserPrefs(PrefService* prefs,
0,
PrefRegistrySyncable::UNSYNCABLE_PREF);
- // If you've never synced before, or if you're using Chrome OS or Android,
- // all datatypes are on by default.
- // TODO(nick): Perhaps a better model would be to always default to false,
- // and explicitly call SetDataTypes() when the user shows the wizard.
-#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
- bool enable_by_default = true;
-#else
- bool enable_by_default = !prefs->HasPrefPath(prefs::kSyncHasSetupCompleted);
-#endif
-
+ // All datatypes are on by default, but this gets set explicitly
+ // when you configure sync (when turning it on), in
+ // ProfileSyncService::OnUserChoseDatatypes.
registry->RegisterBooleanPref(prefs::kSyncKeepEverythingSynced,
- enable_by_default,
+ true,
PrefRegistrySyncable::UNSYNCABLE_PREF);
syncer::ModelTypeSet user_types = syncer::UserTypes();
@@ -82,7 +74,7 @@ void SyncPrefs::RegisterUserPrefs(PrefService* prefs,
for (syncer::ModelTypeSet::Iterator it = user_types.First();
it.Good(); it.Inc()) {
- RegisterDataTypePreferredPref(registry, it.Get(), enable_by_default);
+ RegisterDataTypePreferredPref(registry, it.Get(), true);
}
registry->RegisterBooleanPref(prefs::kSyncManaged,
« no previous file with comments | « chrome/browser/sync/sync_prefs.h ('k') | chrome/browser/sync/sync_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698