Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 DCHECK(sync_error_controller_ == NULL) | 321 DCHECK(sync_error_controller_ == NULL) |
| 322 << "Initialize() called more than once."; | 322 << "Initialize() called more than once."; |
| 323 sync_error_controller_.reset(new SyncErrorController(this)); | 323 sync_error_controller_.reset(new SyncErrorController(this)); |
| 324 AddObserver(sync_error_controller_.get()); | 324 AddObserver(sync_error_controller_.get()); |
| 325 #endif | 325 #endif |
| 326 | 326 |
| 327 bool running_rollback = false; | 327 bool running_rollback = false; |
| 328 if (browser_sync::BackupRollbackController::IsBackupEnabled()) { | 328 if (browser_sync::BackupRollbackController::IsBackupEnabled()) { |
| 329 // Backup is needed if user's not signed in or signed in but previous | 329 // Backup is needed if user's not signed in or signed in but previous |
| 330 // backup didn't finish, i.e. backend didn't switch from backup to sync. | 330 // backup didn't finish, i.e. backend didn't switch from backup to sync. |
| 331 need_backup_ = signin_->GetEffectiveUsername().empty() || | 331 // Note that backup is never performed for supervised users (which always |
| 332 sync_prefs_.GetFirstSyncTime().is_null(); | 332 // start with a fresh profile anyways). |
| 333 need_backup_ = (signin_->GetEffectiveUsername().empty() || | |
|
Marc Treib
2014/09/25 09:31:51
If you want to exclude supervised users, I think i
Nicolas Zea
2014/09/26 01:26:48
Unfortunately I don't think that will work. The fi
| |
| 334 sync_prefs_.GetFirstSyncTime().is_null()) && | |
| 335 !profile_->IsSupervised(); | |
| 333 | 336 |
| 334 // Try to resume rollback if it didn't finish in last session. | 337 // Try to resume rollback if it didn't finish in last session. |
| 335 running_rollback = backup_rollback_controller_.StartRollback(); | 338 running_rollback = backup_rollback_controller_.StartRollback(); |
| 336 } else { | 339 } else { |
| 337 need_backup_ = false; | 340 need_backup_ = false; |
| 338 } | 341 } |
| 339 | 342 |
| 340 #if defined(ENABLE_PRE_SYNC_BACKUP) | 343 #if defined(ENABLE_PRE_SYNC_BACKUP) |
| 341 if (!running_rollback && signin_->GetEffectiveUsername().empty()) { | 344 if (!running_rollback && signin_->GetEffectiveUsername().empty()) { |
| 342 CleanUpBackup(); | 345 CleanUpBackup(); |
| (...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2720 true)); | 2723 true)); |
| 2721 } | 2724 } |
| 2722 | 2725 |
| 2723 bool ProfileSyncService::NeedBackup() const { | 2726 bool ProfileSyncService::NeedBackup() const { |
| 2724 return need_backup_; | 2727 return need_backup_; |
| 2725 } | 2728 } |
| 2726 | 2729 |
| 2727 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { | 2730 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { |
| 2728 return device_info_sync_service_->GetLocalDeviceBackupTime(); | 2731 return device_info_sync_service_->GetLocalDeviceBackupTime(); |
| 2729 } | 2732 } |
| OLD | NEW |