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

Unified Diff: headless/lib/browser/headless_browser_context_impl.cc

Issue 2886693002: initial version of the headless download manager delegate
Patch Set: initial version of the headless download manager delegate Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/browser/headless_browser_context_impl.h ('k') | headless/lib/browser/headless_browser_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_browser_context_impl.cc
diff --git a/headless/lib/browser/headless_browser_context_impl.cc b/headless/lib/browser/headless_browser_context_impl.cc
index 3da6febdc80e2507eabaa8a562ca8cca40ba132d..7c00138012db54bdb8079b60a27df4c57d7fd867 100644
--- a/headless/lib/browser/headless_browser_context_impl.cc
+++ b/headless/lib/browser/headless_browser_context_impl.cc
@@ -19,6 +19,7 @@
#include "headless/lib/browser/headless_browser_context_options.h"
#include "headless/lib/browser/headless_browser_impl.h"
#include "headless/lib/browser/headless_browser_main_parts.h"
+#include "headless/lib/browser/headless_download_manager_delegate.h"
#include "headless/lib/browser/headless_net_log.h"
#include "headless/lib/browser/headless_permission_manager.h"
#include "headless/lib/browser/headless_url_request_context_getter.h"
@@ -202,7 +203,13 @@ content::ResourceContext* HeadlessBrowserContextImpl::GetResourceContext() {
content::DownloadManagerDelegate*
HeadlessBrowserContextImpl::GetDownloadManagerDelegate() {
- return nullptr;
+ if (!download_manager_delegate_.get()) {
+ download_manager_delegate_.reset(new HeadlessDownloadManagerDelegate());
+ download_manager_delegate_->SetDownloadManager(
+ BrowserContext::GetDownloadManager(this));
+ }
+
+ return download_manager_delegate_.get();
}
content::BrowserPluginGuestManager*
« no previous file with comments | « headless/lib/browser/headless_browser_context_impl.h ('k') | headless/lib/browser/headless_browser_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698