| Index: chrome/browser/sync_file_system/drive_backend/sync_engine.cc
|
| diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
|
| index c2ca930e24397fe9fbef61f66455aa41de0dfaf4..320e6f6604a0101caa012ed577ada6b33bcf01d9 100644
|
| --- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
|
| +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
|
| @@ -576,16 +576,37 @@ void SyncEngine::DumpDatabase(const ListCallback& callback) {
|
| }
|
|
|
| void SyncEngine::SetSyncEnabled(bool sync_enabled) {
|
| + if (sync_enabled_ == sync_enabled)
|
| + return;
|
| sync_enabled_ = sync_enabled;
|
|
|
| + if (sync_enabled_) {
|
| + if (!sync_worker_)
|
| + Initialize();
|
| +
|
| + // Have no login credential.
|
| + if (!sync_worker_)
|
| + return;
|
| +
|
| + worker_task_runner_->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&SyncWorkerInterface::SetSyncEnabled,
|
| + base::Unretained(sync_worker_.get()),
|
| + sync_enabled_));
|
| + return;
|
| + }
|
| +
|
| if (!sync_worker_)
|
| return;
|
|
|
| + // TODO(tzik): Consider removing SyncWorkerInterface::SetSyncEnabled and
|
| + // let SyncEngine handle the flag.
|
| worker_task_runner_->PostTask(
|
| FROM_HERE,
|
| base::Bind(&SyncWorkerInterface::SetSyncEnabled,
|
| base::Unretained(sync_worker_.get()),
|
| - sync_enabled));
|
| + sync_enabled_));
|
| + Reset();
|
| }
|
|
|
| void SyncEngine::PromoteDemotedChanges(const base::Closure& callback) {
|
|
|