Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_system_service.cc

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 30 matching lines...) Expand all
41 void GDataSystemService::Initialize() { 41 void GDataSystemService::Initialize() {
42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
43 43
44 // This order is necessary so the sync_client_ doesn't miss 44 // This order is necessary so the sync_client_ doesn't miss
45 // OnCacheInitialized() notification. 45 // OnCacheInitialized() notification.
46 sync_client_->Initialize(); 46 sync_client_->Initialize();
47 file_system_->Initialize(); 47 file_system_->Initialize();
48 48
49 content::DownloadManager* download_manager = 49 content::DownloadManager* download_manager =
50 g_browser_process->download_status_updater() ? 50 g_browser_process->download_status_updater() ?
51 DownloadServiceFactory::GetForProfile(profile_)->GetDownloadManager() : 51 BrowserContext::GetDownloadManager(profile_) : NULL;
52 NULL;
53 download_observer_->Initialize( 52 download_observer_->Initialize(
54 uploader_.get(), 53 uploader_.get(),
55 download_manager, 54 download_manager,
56 file_system_->GetCacheDirectoryPath( 55 file_system_->GetCacheDirectoryPath(
57 GDataCache::CACHE_TYPE_TMP_DOWNLOADS)); 56 GDataCache::CACHE_TYPE_TMP_DOWNLOADS));
58 } 57 }
59 58
60 void GDataSystemService::Shutdown() { 59 void GDataSystemService::Shutdown() {
61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
62 61
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 99 }
101 100
102 ProfileKeyedService* GDataSystemServiceFactory::BuildServiceInstanceFor( 101 ProfileKeyedService* GDataSystemServiceFactory::BuildServiceInstanceFor(
103 Profile* profile) const { 102 Profile* profile) const {
104 GDataSystemService* service = new GDataSystemService(profile); 103 GDataSystemService* service = new GDataSystemService(profile);
105 service->Initialize(); 104 service->Initialize();
106 return service; 105 return service;
107 } 106 }
108 107
109 } // namespace gdata 108 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698