| 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/download/download_service.h" | 10 #include "chrome/browser/download/download_service.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 void GDataSystemService::Initialize() { | 38 void GDataSystemService::Initialize() { |
| 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 40 | 40 |
| 41 file_system_->Initialize(); | 41 file_system_->Initialize(); |
| 42 | 42 |
| 43 content::DownloadManager* download_manager = | 43 content::DownloadManager* download_manager = |
| 44 g_browser_process->download_status_updater() ? | 44 g_browser_process->download_status_updater() ? |
| 45 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager() : | 45 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager() : |
| 46 NULL; | 46 NULL; |
| 47 download_observer_->Initialize(uploader_.get(), download_manager, | 47 download_observer_->Initialize( |
| 48 file_system_->GetGDataTempDownloadFolderPath()); | 48 uploader_.get(), |
| 49 download_manager, |
| 50 file_system_->GetCacheDirectoryPath( |
| 51 GDataRootDirectory::CACHE_TYPE_TMP_DOWNLOADS)); |
| 49 | 52 |
| 50 sync_client_->Initialize(); | 53 sync_client_->Initialize(); |
| 51 } | 54 } |
| 52 | 55 |
| 53 void GDataSystemService::Shutdown() { | 56 void GDataSystemService::Shutdown() { |
| 54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 57 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 55 | 58 |
| 56 // These should shut down here as they depend on |file_system_|. | 59 // These should shut down here as they depend on |file_system_|. |
| 57 sync_client_.reset(); | 60 sync_client_.reset(); |
| 58 download_observer_.reset(); | 61 download_observer_.reset(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 95 } |
| 93 | 96 |
| 94 ProfileKeyedService* GDataSystemServiceFactory::BuildServiceInstanceFor( | 97 ProfileKeyedService* GDataSystemServiceFactory::BuildServiceInstanceFor( |
| 95 Profile* profile) const { | 98 Profile* profile) const { |
| 96 GDataSystemService* service = new GDataSystemService(profile); | 99 GDataSystemService* service = new GDataSystemService(profile); |
| 97 service->Initialize(); | 100 service->Initialize(); |
| 98 return service; | 101 return service; |
| 99 } | 102 } |
| 100 | 103 |
| 101 } // namespace gdata | 104 } // namespace gdata |
| OLD | NEW |