| 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/drive_system_service.h" | 5 #include "chrome/browser/chromeos/gdata/drive_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_download_observer.h" | 11 #include "chrome/browser/chromeos/gdata/drive_download_observer.h" |
| 12 #include "chrome/browser/chromeos/gdata/drive_file_system.h" | 12 #include "chrome/browser/chromeos/gdata/drive_file_system.h" |
| 13 #include "chrome/browser/chromeos/gdata/drive_file_system_proxy.h" | 13 #include "chrome/browser/chromeos/gdata/drive_file_system_proxy.h" |
| 14 #include "chrome/browser/chromeos/gdata/drive_file_system_util.h" | 14 #include "chrome/browser/chromeos/gdata/drive_file_system_util.h" |
| 15 #include "chrome/browser/chromeos/gdata/drive_uploader.h" |
| 15 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" | 16 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" |
| 16 #include "chrome/browser/chromeos/gdata/file_write_helper.h" | 17 #include "chrome/browser/chromeos/gdata/file_write_helper.h" |
| 17 #include "chrome/browser/chromeos/gdata/gdata_sync_client.h" | 18 #include "chrome/browser/chromeos/gdata/gdata_sync_client.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" |
| 27 #include "webkit/fileapi/file_system_context.h" | 27 #include "webkit/fileapi/file_system_context.h" |
| 28 #include "webkit/fileapi/file_system_mount_point_provider.h" | 28 #include "webkit/fileapi/file_system_mount_point_provider.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 56 | 56 |
| 57 void DriveSystemService::Initialize( | 57 void DriveSystemService::Initialize( |
| 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 DriveUploader(drive_service_.get())); |
| 67 webapps_registry_.reset(new DriveWebAppsRegistry); | 67 webapps_registry_.reset(new DriveWebAppsRegistry); |
| 68 file_system_.reset(new DriveFileSystem(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 DriveDownloadObserver(uploader(), | 75 download_observer_.reset(new DriveDownloadObserver(uploader(), |
| 76 file_system())); | 76 file_system())); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 g_test_cache_root ? FilePath(*g_test_cache_root) : | 220 g_test_cache_root ? FilePath(*g_test_cache_root) : |
| 221 DriveCache::GetCacheRootPath(profile); | 221 DriveCache::GetCacheRootPath(profile); |
| 222 delete g_test_cache_root; | 222 delete g_test_cache_root; |
| 223 g_test_cache_root = NULL; | 223 g_test_cache_root = NULL; |
| 224 | 224 |
| 225 service->Initialize(drive_service, cache_root); | 225 service->Initialize(drive_service, cache_root); |
| 226 return service; | 226 return service; |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace gdata | 229 } // namespace gdata |
| OLD | NEW |