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

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

Issue 1891843004: [headless] AddWindowTreeClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to latest master Created 4 years, 8 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/app/headless_shell.cc ('k') | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eadeb56b64d8834a2b3930f6b944d1dd1500dd86..53bcf1385ac5ce0a380bfe692c73de955d1d1c37 100644
--- a/headless/lib/browser/headless_browser_impl.h
+++ b/headless/lib/browser/headless_browser_impl.h
@@ -8,12 +8,17 @@
#include "headless/public/headless_browser.h"
#include <memory>
+#include <unordered_map>
#include "base/synchronization/lock.h"
#include "headless/lib/browser/headless_web_contents_impl.h"
namespace aura {
class WindowTreeHost;
+
+namespace client {
+class WindowTreeClient;
+}
}
namespace headless {
@@ -29,14 +34,15 @@ class HeadlessBrowserImpl : public HeadlessBrowser {
~HeadlessBrowserImpl() override;
// HeadlessBrowser implementation:
- std::unique_ptr<HeadlessWebContents> CreateWebContents(
- const GURL& initial_url,
- const gfx::Size& size) override;
+ HeadlessWebContents* CreateWebContents(const GURL& initial_url,
+ const gfx::Size& size) override;
scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread()
const override;
void Shutdown() override;
+ std::vector<HeadlessWebContents*> GetAllWebContents() override;
+
void set_browser_main_parts(HeadlessBrowserMainParts* browser_main_parts);
HeadlessBrowserMainParts* browser_main_parts() const;
@@ -46,6 +52,12 @@ class HeadlessBrowserImpl : public HeadlessBrowser {
const HeadlessBrowser::Options& options() const { return options_; }
+ HeadlessWebContentsImpl* RegisterWebContents(
+ std::unique_ptr<HeadlessWebContentsImpl> web_contents);
+
+ // Close given |web_contents| and delete it.
+ void DestroyWebContents(HeadlessWebContentsImpl* web_contents);
+
// Customize the options used by this headless browser instance. Note that
// options which take effect before the message loop has been started (e.g.,
// custom message pumps) cannot be set via this method.
@@ -56,6 +68,10 @@ class HeadlessBrowserImpl : public HeadlessBrowser {
HeadlessBrowser::Options options_;
HeadlessBrowserMainParts* browser_main_parts_; // Not owned.
std::unique_ptr<aura::WindowTreeHost> window_tree_host_;
+ std::unique_ptr<aura::client::WindowTreeClient> window_tree_client_;
+
+ std::unordered_map<HeadlessWebContents*, std::unique_ptr<HeadlessWebContents>>
+ web_contents_;
DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl);
};
« no previous file with comments | « headless/app/headless_shell.cc ('k') | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698