| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_file_system/drive_backend/sync_engine.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 bool SyncEngine::IsConflicting(const fileapi::FileSystemURL& url) { | 343 bool SyncEngine::IsConflicting(const fileapi::FileSystemURL& url) { |
| 344 // TODO(tzik): Implement this before we support manual conflict resolution. | 344 // TODO(tzik): Implement this before we support manual conflict resolution. |
| 345 return false; | 345 return false; |
| 346 } | 346 } |
| 347 | 347 |
| 348 RemoteServiceState SyncEngine::GetCurrentState() const { | 348 RemoteServiceState SyncEngine::GetCurrentState() const { |
| 349 return service_state_; | 349 return service_state_; |
| 350 } | 350 } |
| 351 | 351 |
| 352 void SyncEngine::GetOriginStatusMap(OriginStatusMap* status_map) { | 352 void SyncEngine::GetOriginStatusMap(const StatusMapCallback& callback) { |
| 353 // TODO(peria): Make this route asynchronous. | 353 worker_task_runner_->PostTask( |
| 354 sync_worker_->GetOriginStatusMap(status_map); | 354 FROM_HERE, |
| 355 base::Bind(&SyncWorker::GetOriginStatusMap, |
| 356 base::Unretained(sync_worker_.get()), |
| 357 RelayCallbackToCurrentThread( |
| 358 FROM_HERE, callback))); |
| 355 } | 359 } |
| 356 | 360 |
| 357 void SyncEngine::DumpFiles(const GURL& origin, | 361 void SyncEngine::DumpFiles(const GURL& origin, |
| 358 const ListCallback& callback) { | 362 const ListCallback& callback) { |
| 359 PostTaskAndReplyWithResult( | 363 PostTaskAndReplyWithResult( |
| 360 worker_task_runner_, | 364 worker_task_runner_, |
| 361 FROM_HERE, | 365 FROM_HERE, |
| 362 base::Bind(&SyncWorker::DumpFiles, | 366 base::Bind(&SyncWorker::DumpFiles, |
| 363 base::Unretained(sync_worker_.get()), | 367 base::Unretained(sync_worker_.get()), |
| 364 origin), | 368 origin), |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; | 586 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; |
| 583 if (is_app_enabled && !is_app_root_tracker_enabled) | 587 if (is_app_enabled && !is_app_root_tracker_enabled) |
| 584 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); | 588 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); |
| 585 else if (!is_app_enabled && is_app_root_tracker_enabled) | 589 else if (!is_app_enabled && is_app_root_tracker_enabled) |
| 586 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); | 590 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); |
| 587 } | 591 } |
| 588 } | 592 } |
| 589 | 593 |
| 590 } // namespace drive_backend | 594 } // namespace drive_backend |
| 591 } // namespace sync_file_system | 595 } // namespace sync_file_system |
| OLD | NEW |