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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 profile_ = NULL; | 115 profile_ = NULL; |
116 } | 116 } |
117 | 117 |
118 SyncFileSystemService::~SyncFileSystemService() { | 118 SyncFileSystemService::~SyncFileSystemService() { |
119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
120 DCHECK(!profile_); | 120 DCHECK(!profile_); |
121 } | 121 } |
122 | 122 |
123 void SyncFileSystemService::InitializeForApp( | 123 void SyncFileSystemService::InitializeForApp( |
124 fileapi::FileSystemContext* file_system_context, | 124 fileapi::FileSystemContext* file_system_context, |
125 const std::string& service_name, | |
126 const GURL& app_origin, | 125 const GURL& app_origin, |
127 const SyncStatusCallback& callback) { | 126 const SyncStatusCallback& callback) { |
128 DCHECK(local_file_service_); | 127 DCHECK(local_file_service_); |
129 DCHECK(remote_file_service_); | 128 DCHECK(remote_file_service_); |
130 DCHECK(app_origin == app_origin.GetOrigin()); | 129 DCHECK(app_origin == app_origin.GetOrigin()); |
131 | 130 |
132 DVLOG(1) << "InitializeForApp: " << app_origin.spec(); | 131 DVLOG(1) << "InitializeForApp: " << app_origin.spec(); |
133 | 132 |
134 local_file_service_->MaybeInitializeFileSystemContext( | 133 local_file_service_->MaybeInitializeFileSystemContext( |
135 app_origin, service_name, file_system_context, | 134 app_origin, file_system_context, |
136 base::Bind(&SyncFileSystemService::DidInitializeFileSystem, | 135 base::Bind(&SyncFileSystemService::DidInitializeFileSystem, |
137 AsWeakPtr(), app_origin, callback)); | 136 AsWeakPtr(), app_origin, callback)); |
138 } | 137 } |
139 | 138 |
140 SyncServiceState SyncFileSystemService::GetSyncServiceState() { | 139 SyncServiceState SyncFileSystemService::GetSyncServiceState() { |
141 return RemoteStateToSyncServiceState(remote_file_service_->GetCurrentState()); | 140 return RemoteStateToSyncServiceState(remote_file_service_->GetCurrentState()); |
142 } | 141 } |
143 | 142 |
144 void SyncFileSystemService::GetFileSyncStatus( | 143 void SyncFileSystemService::GetFileSyncStatus( |
145 const FileSystemURL& url, const SyncFileStatusCallback& callback) { | 144 const FileSystemURL& url, const SyncFileStatusCallback& callback) { |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 syncer::APPS); | 567 syncer::APPS); |
569 remote_file_service_->SetSyncEnabled(sync_enabled_); | 568 remote_file_service_->SetSyncEnabled(sync_enabled_); |
570 if (sync_enabled_) { | 569 if (sync_enabled_) { |
571 base::MessageLoopProxy::current()->PostTask( | 570 base::MessageLoopProxy::current()->PostTask( |
572 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 571 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
573 AsWeakPtr())); | 572 AsWeakPtr())); |
574 } | 573 } |
575 } | 574 } |
576 | 575 |
577 } // namespace sync_file_system | 576 } // namespace sync_file_system |
OLD | NEW |