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

Unified Diff: headless/lib/browser/headless_browser_impl.h

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
Index: headless/lib/browser/headless_browser_impl.h
diff --git a/headless/lib/browser/headless_browser_impl.h b/headless/lib/browser/headless_browser_impl.h
index 485753de4d86d6cd17f909e145b0126699e897ed..1f7b57ca16bcbafd51665b41273d95a563921ca9 100644
--- a/headless/lib/browser/headless_browser_impl.h
+++ b/headless/lib/browser/headless_browser_impl.h
@@ -12,10 +12,13 @@
#include <unordered_map>
#include <vector>
+#include "base/files/file_util.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
#include "base/single_thread_task_runner.h"
#include "content/public/browser/web_contents.h"
#include "headless/lib/browser/headless_devtools_manager_delegate.h"
+#include "headless/lib/browser/headless_download_manager_delegate.h"
#include "headless/lib/browser/headless_web_contents_impl.h"
#include "headless/public/headless_export.h"
@@ -76,6 +79,15 @@ class HEADLESS_EXPORT HeadlessBrowserImpl : public HeadlessBrowser,
base::WeakPtr<HeadlessBrowserImpl> GetWeakPtr();
+ // Set the download behaviour of the HeadlessDownloadManagerDelegate for all
+ // current and future browser contexts.
+ void SetDownloadBehavior(
+ HeadlessDownloadManagerDelegate::DownloadBehavior behavior);
+
+ // Set the download directory of the HeadlessDownloadManagerDelegate for all
+ // current and future browser contexts.
+ void SetDownloadDirectory(const base::FilePath& path);
+
// All the methods that begin with Platform need to be implemented by the
// platform specific headless implementation.
// Helper for one time initialization of application
@@ -93,6 +105,10 @@ class HEADLESS_EXPORT HeadlessBrowserImpl : public HeadlessBrowser,
browser_contexts_;
HeadlessBrowserContext* default_browser_context_; // Not owned.
+ base::Optional<HeadlessDownloadManagerDelegate::DownloadBehavior>
+ download_behavior_;
+ base::Optional<base::FilePath> download_path_;
+
scoped_refptr<content::DevToolsAgentHost> agent_host_;
base::WeakPtrFactory<HeadlessBrowserImpl> weak_ptr_factory_;
« no previous file with comments | « headless/lib/browser/headless_browser_context_impl.cc ('k') | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698