OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "content/browser/appcache/chrome_appcache_service.h" | 10 #include "content/browser/appcache/chrome_appcache_service.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 download_manager_delegate_ = new ShellDownloadManagerDelegate(); | 124 download_manager_delegate_ = new ShellDownloadManagerDelegate(); |
125 download_manager_ = new DownloadManager(download_manager_delegate_, | 125 download_manager_ = new DownloadManager(download_manager_delegate_, |
126 download_status_updater_.get()); | 126 download_status_updater_.get()); |
127 download_manager_delegate_->SetDownloadManager(download_manager_.get()); | 127 download_manager_delegate_->SetDownloadManager(download_manager_.get()); |
128 download_manager_->Init(this); | 128 download_manager_->Init(this); |
129 } | 129 } |
130 return download_manager_.get(); | 130 return download_manager_.get(); |
131 } | 131 } |
132 | 132 |
133 bool ShellBrowserContext::HasCreatedDownloadManager() const { | |
134 return download_manager_.get() != NULL; | |
135 } | |
136 | |
137 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { | 133 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { |
138 if (!url_request_getter_) { | 134 if (!url_request_getter_) { |
139 url_request_getter_ = new ShellURLRequestContextGetter( | 135 url_request_getter_ = new ShellURLRequestContextGetter( |
140 GetPath(), | 136 GetPath(), |
141 shell_main_parts_->io_thread()->message_loop(), | 137 shell_main_parts_->io_thread()->message_loop(), |
142 shell_main_parts_->file_thread()->message_loop()); | 138 shell_main_parts_->file_thread()->message_loop()); |
143 } | 139 } |
144 return url_request_getter_; | 140 return url_request_getter_; |
145 } | 141 } |
146 | 142 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 NewRunnableMethod( | 248 NewRunnableMethod( |
253 appcache_service_.get(), | 249 appcache_service_.get(), |
254 &ChromeAppCacheService::InitializeOnIOThread, | 250 &ChromeAppCacheService::InitializeOnIOThread, |
255 IsOffTheRecord() | 251 IsOffTheRecord() |
256 ? FilePath() : GetPath().Append(FILE_PATH_LITERAL("AppCache")), | 252 ? FilePath() : GetPath().Append(FILE_PATH_LITERAL("AppCache")), |
257 &GetResourceContext(), | 253 &GetResourceContext(), |
258 special_storage_policy)); | 254 special_storage_policy)); |
259 } | 255 } |
260 | 256 |
261 } // namespace content | 257 } // namespace content |
OLD | NEW |