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/chromeos/gdata/gdata_system_service.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/gdata/drive_api_service.h" | 10 #include "chrome/browser/chromeos/gdata/drive_api_service.h" |
| 11 #include "chrome/browser/chromeos/gdata/drive_file_system.h" |
| 12 #include "chrome/browser/chromeos/gdata/drive_file_system_proxy.h" |
11 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" | 13 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" |
12 #include "chrome/browser/chromeos/gdata/file_write_helper.h" | 14 #include "chrome/browser/chromeos/gdata/file_write_helper.h" |
13 #include "chrome/browser/chromeos/gdata/gdata_contacts_service.h" | 15 #include "chrome/browser/chromeos/gdata/gdata_contacts_service.h" |
14 #include "chrome/browser/chromeos/gdata/gdata_download_observer.h" | 16 #include "chrome/browser/chromeos/gdata/gdata_download_observer.h" |
15 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" | |
16 #include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h" | |
17 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h" | 17 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h" |
18 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" | 18 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" |
19 #include "chrome/browser/chromeos/gdata/gdata_util.h" | 19 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
20 #include "chrome/browser/chromeos/gdata/gdata_wapi_service.h" | 20 #include "chrome/browser/chromeos/gdata/gdata_wapi_service.h" |
21 #include "chrome/browser/download/download_service.h" | 21 #include "chrome/browser/download/download_service.h" |
22 #include "chrome/browser/download/download_service_factory.h" | 22 #include "chrome/browser/download/download_service_factory.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/profiles/profile_dependency_manager.h" | 24 #include "chrome/browser/profiles/profile_dependency_manager.h" |
25 #include "content/public/browser/browser_context.h" | 25 #include "content/public/browser/browser_context.h" |
26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 DriveServiceInterface* drive_service, | 58 DriveServiceInterface* drive_service, |
59 const FilePath& cache_root) { | 59 const FilePath& cache_root) { |
60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
61 | 61 |
62 drive_service_.reset(drive_service); | 62 drive_service_.reset(drive_service); |
63 cache_ = DriveCache::CreateDriveCacheOnUIThread( | 63 cache_ = DriveCache::CreateDriveCacheOnUIThread( |
64 cache_root, | 64 cache_root, |
65 blocking_task_runner_); | 65 blocking_task_runner_); |
66 uploader_.reset(new GDataUploader(drive_service_.get())); | 66 uploader_.reset(new GDataUploader(drive_service_.get())); |
67 webapps_registry_.reset(new DriveWebAppsRegistry); | 67 webapps_registry_.reset(new DriveWebAppsRegistry); |
68 file_system_.reset(new GDataFileSystem(profile_, | 68 file_system_.reset(new DriveFileSystem(profile_, |
69 cache(), | 69 cache(), |
70 drive_service_.get(), | 70 drive_service_.get(), |
71 uploader(), | 71 uploader(), |
72 webapps_registry(), | 72 webapps_registry(), |
73 blocking_task_runner_)); | 73 blocking_task_runner_)); |
74 file_write_helper_.reset(new FileWriteHelper(file_system())); | 74 file_write_helper_.reset(new FileWriteHelper(file_system())); |
75 download_observer_.reset(new GDataDownloadObserver(uploader(), | 75 download_observer_.reset(new GDataDownloadObserver(uploader(), |
76 file_system())); | 76 file_system())); |
77 sync_client_.reset(new GDataSyncClient(profile_, file_system(), cache())); | 77 sync_client_.reset(new GDataSyncClient(profile_, file_system(), cache())); |
78 contacts_service_.reset(new GDataContactsService(profile_)); | 78 contacts_service_.reset(new GDataContactsService(profile_)); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 void GDataSystemService::AddDriveMountPoint() { | 135 void GDataSystemService::AddDriveMountPoint() { |
136 if (!gdata::util::IsGDataAvailable(profile_)) | 136 if (!gdata::util::IsGDataAvailable(profile_)) |
137 return; | 137 return; |
138 | 138 |
139 const FilePath mount_point = gdata::util::GetGDataMountPointPath(); | 139 const FilePath mount_point = gdata::util::GetGDataMountPointPath(); |
140 fileapi::ExternalFileSystemMountPointProvider* provider = | 140 fileapi::ExternalFileSystemMountPointProvider* provider = |
141 BrowserContext::GetFileSystemContext(profile_)->external_provider(); | 141 BrowserContext::GetFileSystemContext(profile_)->external_provider(); |
142 if (provider && !provider->HasMountPoint(mount_point)) { | 142 if (provider && !provider->HasMountPoint(mount_point)) { |
143 provider->AddRemoteMountPoint( | 143 provider->AddRemoteMountPoint( |
144 mount_point, | 144 mount_point, |
145 new GDataFileSystemProxy(file_system_.get())); | 145 new DriveFileSystemProxy(file_system_.get())); |
146 } | 146 } |
147 | 147 |
148 file_system_->Initialize(); | 148 file_system_->Initialize(); |
149 file_system_->NotifyFileSystemMounted(); | 149 file_system_->NotifyFileSystemMounted(); |
150 } | 150 } |
151 | 151 |
152 void GDataSystemService::RemoveDriveMountPoint() { | 152 void GDataSystemService::RemoveDriveMountPoint() { |
153 file_system_->NotifyFileSystemToBeUnmounted(); | 153 file_system_->NotifyFileSystemToBeUnmounted(); |
154 file_system_->StopUpdates(); | 154 file_system_->StopUpdates(); |
155 | 155 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 g_test_cache_root ? FilePath(*g_test_cache_root) : | 223 g_test_cache_root ? FilePath(*g_test_cache_root) : |
224 DriveCache::GetCacheRootPath(profile); | 224 DriveCache::GetCacheRootPath(profile); |
225 delete g_test_cache_root; | 225 delete g_test_cache_root; |
226 g_test_cache_root = NULL; | 226 g_test_cache_root = NULL; |
227 | 227 |
228 service->Initialize(drive_service, cache_root); | 228 service->Initialize(drive_service, cache_root); |
229 return service; | 229 return service; |
230 } | 230 } |
231 | 231 |
232 } // namespace gdata | 232 } // namespace gdata |
OLD | NEW |