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

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

Issue 11364024: Revert 165326 - [Sync] Unrevert fix for bug 154940 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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: chrome/browser/sync/profile_sync_service.cc
===================================================================
--- chrome/browser/sync/profile_sync_service.cc (revision 165332)
+++ chrome/browser/sync/profile_sync_service.cc (working copy)
@@ -28,7 +28,6 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/net/chrome_cookie_notification_details.h"
-#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
@@ -53,7 +52,6 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
-#include "chrome/common/pref_names.h"
#include "chrome/common/time_format.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/notification_details.h"
@@ -218,45 +216,9 @@
DisableForUser();
}
- TrySyncDatatypePrefRecovery();
-
TryStart();
}
-void ProfileSyncService::TrySyncDatatypePrefRecovery() {
- DCHECK(!sync_initialized());
- if (!HasSyncSetupCompleted())
- return;
-
- // There was a bug where OnUserChoseDatatypes was not properly called on
- // configuration (see crbug.com/154940). We detect this by checking whether
- // kSyncKeepEverythingSynced has a default value. If so, and sync setup has
- // completed, it means sync was not properly configured, so we manually
- // set kSyncKeepEverythingSynced.
- PrefService* const pref_service = profile_->GetPrefs();
- if (!pref_service)
- return;
- if (sync_prefs_.HasKeepEverythingSynced())
- return;
- const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes();
- if (sync_prefs_.GetPreferredDataTypes(registered_types).Size() > 1)
- return;
-
- const PrefService::Preference* keep_everything_synced =
- pref_service->FindPreference(prefs::kSyncKeepEverythingSynced);
- // This will be false if the preference was properly set or if it's controlled
- // by policy.
- if (!keep_everything_synced->IsDefaultValue())
- return;
-
- // kSyncKeepEverythingSynced was not properly set. Set it and the preferred
- // types now, before we configure.
- UMA_HISTOGRAM_COUNTS("Sync.DatatypePrefRecovery", 1);
- sync_prefs_.SetKeepEverythingSynced(true);
- sync_prefs_.SetPreferredDataTypes(registered_types,
- registered_types);
-}
-
void ProfileSyncService::TryStart() {
if (!IsSyncEnabledAndLoggedIn())
return;
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698