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; |