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/drive/drive_system_service.h" | 5 #include "chrome/browser/chromeos/drive/drive_system_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/chromeos/drive/download_handler.h" | 11 #include "chrome/browser/chromeos/drive/download_handler.h" |
12 #include "chrome/browser/chromeos/drive/drive_cache.h" | 12 #include "chrome/browser/chromeos/drive/drive_cache.h" |
13 #include "chrome/browser/chromeos/drive/drive_file_system.h" | 13 #include "chrome/browser/chromeos/drive/drive_file_system.h" |
14 #include "chrome/browser/chromeos/drive/drive_prefetcher.h" | |
15 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h" | 14 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h" |
16 #include "chrome/browser/chromeos/drive/file_system_proxy.h" | 15 #include "chrome/browser/chromeos/drive/file_system_proxy.h" |
17 #include "chrome/browser/chromeos/drive/file_system_util.h" | 16 #include "chrome/browser/chromeos/drive/file_system_util.h" |
18 #include "chrome/browser/chromeos/drive/file_write_helper.h" | 17 #include "chrome/browser/chromeos/drive/file_write_helper.h" |
19 #include "chrome/browser/chromeos/drive/logging.h" | 18 #include "chrome/browser/chromeos/drive/logging.h" |
20 #include "chrome/browser/chromeos/drive/stale_cache_files_remover.h" | 19 #include "chrome/browser/chromeos/drive/stale_cache_files_remover.h" |
21 #include "chrome/browser/chromeos/drive/sync_client.h" | 20 #include "chrome/browser/chromeos/drive/sync_client.h" |
22 #include "chrome/browser/download/download_service.h" | 21 #include "chrome/browser/download/download_service.h" |
23 #include "chrome/browser/download/download_service_factory.h" | 22 #include "chrome/browser/download/download_service_factory.h" |
24 #include "chrome/browser/download/download_util.h" | 23 #include "chrome/browser/download/download_util.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 cache(), | 142 cache(), |
144 drive_service_.get(), | 143 drive_service_.get(), |
145 scheduler_.get(), | 144 scheduler_.get(), |
146 webapps_registry(), | 145 webapps_registry(), |
147 resource_metadata_.get(), | 146 resource_metadata_.get(), |
148 blocking_task_runner_)); | 147 blocking_task_runner_)); |
149 file_write_helper_.reset(new FileWriteHelper(file_system())); | 148 file_write_helper_.reset(new FileWriteHelper(file_system())); |
150 download_handler_.reset(new DownloadHandler(file_write_helper(), | 149 download_handler_.reset(new DownloadHandler(file_write_helper(), |
151 file_system())); | 150 file_system())); |
152 sync_client_.reset(new SyncClient(file_system(), cache())); | 151 sync_client_.reset(new SyncClient(file_system(), cache())); |
153 prefetcher_.reset(new DrivePrefetcher(file_system(), | |
154 DrivePrefetcherOptions())); | |
155 stale_cache_files_remover_.reset(new StaleCacheFilesRemover(file_system(), | 152 stale_cache_files_remover_.reset(new StaleCacheFilesRemover(file_system(), |
156 cache())); | 153 cache())); |
157 } | 154 } |
158 | 155 |
159 DriveSystemService::~DriveSystemService() { | 156 DriveSystemService::~DriveSystemService() { |
160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
161 } | 158 } |
162 | 159 |
163 void DriveSystemService::Initialize() { | 160 void DriveSystemService::Initialize() { |
164 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 161 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 if (factory_for_test_.is_null()) | 465 if (factory_for_test_.is_null()) |
469 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); | 466 service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); |
470 else | 467 else |
471 service = factory_for_test_.Run(profile); | 468 service = factory_for_test_.Run(profile); |
472 | 469 |
473 service->Initialize(); | 470 service->Initialize(); |
474 return service; | 471 return service; |
475 } | 472 } |
476 | 473 |
477 } // namespace drive | 474 } // namespace drive |
OLD | NEW |