| 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_file_system/sync_file_system_service.h" | 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 local_file_service_->MaybeInitializeFileSystemContext( | 133 local_file_service_->MaybeInitializeFileSystemContext( |
| 134 app_origin, file_system_context, | 134 app_origin, file_system_context, |
| 135 base::Bind(&SyncFileSystemService::DidInitializeFileSystem, | 135 base::Bind(&SyncFileSystemService::DidInitializeFileSystem, |
| 136 AsWeakPtr(), app_origin, callback)); | 136 AsWeakPtr(), app_origin, callback)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 SyncServiceState SyncFileSystemService::GetSyncServiceState() { | 139 SyncServiceState SyncFileSystemService::GetSyncServiceState() { |
| 140 return RemoteStateToSyncServiceState(remote_file_service_->GetCurrentState()); | 140 return RemoteStateToSyncServiceState(remote_file_service_->GetCurrentState()); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void SyncFileSystemService::GetExtensionStatusMap( |
| 144 std::map<GURL, std::string>* status_map) { |
| 145 DCHECK(status_map); |
| 146 remote_file_service_->GetOriginStatusMap(status_map); |
| 147 } |
| 148 |
| 143 void SyncFileSystemService::GetFileSyncStatus( | 149 void SyncFileSystemService::GetFileSyncStatus( |
| 144 const FileSystemURL& url, const SyncFileStatusCallback& callback) { | 150 const FileSystemURL& url, const SyncFileStatusCallback& callback) { |
| 145 DCHECK(local_file_service_); | 151 DCHECK(local_file_service_); |
| 146 DCHECK(remote_file_service_); | 152 DCHECK(remote_file_service_); |
| 147 | 153 |
| 148 // It's possible to get an invalid FileEntry. | 154 // It's possible to get an invalid FileEntry. |
| 149 if (!url.is_valid()) { | 155 if (!url.is_valid()) { |
| 150 base::MessageLoopProxy::current()->PostTask( | 156 base::MessageLoopProxy::current()->PostTask( |
| 151 FROM_HERE, | 157 FROM_HERE, |
| 152 base::Bind(callback, | 158 base::Bind(callback, |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 syncer::APPS); | 573 syncer::APPS); |
| 568 remote_file_service_->SetSyncEnabled(sync_enabled_); | 574 remote_file_service_->SetSyncEnabled(sync_enabled_); |
| 569 if (sync_enabled_) { | 575 if (sync_enabled_) { |
| 570 base::MessageLoopProxy::current()->PostTask( | 576 base::MessageLoopProxy::current()->PostTask( |
| 571 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 577 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
| 572 AsWeakPtr())); | 578 AsWeakPtr())); |
| 573 } | 579 } |
| 574 } | 580 } |
| 575 | 581 |
| 576 } // namespace sync_file_system | 582 } // namespace sync_file_system |
| OLD | NEW |