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

Side by Side Diff: content/shell/shell_browser_context.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: fix cros compile 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 "content/shell/shell_browser_context.h" 5 #include "content/shell/shell_browser_context.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 FilePath ShellBrowserContext::GetPath() { 121 FilePath ShellBrowserContext::GetPath() {
122 return path_; 122 return path_;
123 } 123 }
124 124
125 bool ShellBrowserContext::IsOffTheRecord() const { 125 bool ShellBrowserContext::IsOffTheRecord() const {
126 return false; 126 return false;
127 } 127 }
128 128
129 DownloadManager* ShellBrowserContext::GetDownloadManager() { 129 DownloadManagerDelegate* ShellBrowserContext::GetDownloadManagerDelegate() {
130 if (!download_manager_.get()) { 130 download_manager_delegate_ = new ShellDownloadManagerDelegate();
131 download_manager_delegate_ = new ShellDownloadManagerDelegate(); 131 return download_manager_delegate_.get();
132 download_manager_ = DownloadManager::Create(download_manager_delegate_,
133 NULL);
134 download_manager_delegate_->SetDownloadManager(download_manager_.get());
135 download_manager_->Init(this);
136 }
137 return download_manager_.get();
138 } 132 }
139 133
140 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { 134 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() {
141 if (!url_request_getter_) { 135 if (!url_request_getter_) {
142 url_request_getter_ = new ShellURLRequestContextGetter( 136 url_request_getter_ = new ShellURLRequestContextGetter(
143 GetPath(), 137 GetPath(),
144 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), 138 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
145 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE)); 139 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE));
146 } 140 }
147 return url_request_getter_; 141 return url_request_getter_;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 178
185 bool ShellBrowserContext::DidLastSessionExitCleanly() { 179 bool ShellBrowserContext::DidLastSessionExitCleanly() {
186 return true; 180 return true;
187 } 181 }
188 182
189 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { 183 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() {
190 return NULL; 184 return NULL;
191 } 185 }
192 186
193 } // namespace content 187 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698