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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 605483002: [Sync] Fix sync backup for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix backup to work for supervised users Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc
index 4624863734869bf6ef7a274761201d4866635f26..f09fc44014e535a886e63189069096544bd50602 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -407,7 +407,8 @@ syncer::ModelTypeSet SupervisedUserService::GetPreferredDataTypes() const {
void SupervisedUserService::OnStateChanged() {
Marc Treib 2014/09/26 08:42:38 This does get called when the backend_mode changes
Nicolas Zea 2014/09/26 17:09:22 It does. And it looks like that comment is quite o
ProfileSyncService* service =
ProfileSyncServiceFactory::GetForProfile(profile_);
- if (waiting_for_sync_initialization_ && service->sync_initialized()) {
+ if (waiting_for_sync_initialization_ && service->sync_initialized() &&
+ service->backend_mode() == ProfileSyncService::SYNC) {
waiting_for_sync_initialization_ = false;
service->RemoveObserver(this);
FinishSetupSync();
@@ -438,7 +439,8 @@ void SupervisedUserService::FinishSetupSyncWhenReady() {
// Continue in FinishSetupSync() once the Sync backend has been initialized.
ProfileSyncService* service =
ProfileSyncServiceFactory::GetForProfile(profile_);
- if (service->sync_initialized()) {
+ if (service->sync_initialized() &&
+ service->backend_mode() == ProfileSyncService::SYNC) {
FinishSetupSync();
} else {
service->AddObserver(this);
@@ -449,7 +451,8 @@ void SupervisedUserService::FinishSetupSyncWhenReady() {
void SupervisedUserService::FinishSetupSync() {
ProfileSyncService* service =
ProfileSyncServiceFactory::GetForProfile(profile_);
- DCHECK(service->sync_initialized());
+ DCHECK(service->sync_initialized() &&
Marc Treib 2014/09/26 08:42:38 Hm, so the underlying problem was that sync_initia
Nicolas Zea 2014/09/26 17:09:22 Yeah, I agree this is confusing. For now, since th
+ service->backend_mode() == ProfileSyncService::SYNC);
// Sync nothing (except types which are set via GetPreferredDataTypes).
bool sync_everything = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698