Chromium Code Reviews| 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 f37dff1dbc45b8c135fde8db85f6f33f53ff0160..eb5af5eb4c11eb466ceccb39be336f712ad270dd 100644 |
| --- a/headless/lib/browser/headless_browser_impl.h |
| +++ b/headless/lib/browser/headless_browser_impl.h |
| @@ -13,16 +13,13 @@ |
| #include <vector> |
| #include "base/memory/weak_ptr.h" |
| +#include "content/public/browser/web_contents.h" |
| #include "headless/lib/browser/headless_devtools_manager_delegate.h" |
| #include "headless/lib/browser/headless_web_contents_impl.h" |
| -namespace aura { |
| -class WindowTreeHost; |
| - |
| -namespace client { |
| -class WindowParentingClient; |
| -} |
| -} |
| +#if defined(USE_AURA) |
| +#include "headless/lib/browser/headless_window_tree_host.h" |
| +#endif |
| namespace headless { |
| @@ -70,18 +67,24 @@ class HeadlessBrowserImpl : public HeadlessBrowser { |
| base::WeakPtr<HeadlessBrowserImpl> GetWeakPtr(); |
| - aura::WindowTreeHost* window_tree_host() const; |
| + // All the methods that begin with Platform need to be implemented by the |
| + // platform specific headless implementation. |
| + // Helper for one time initialization of application |
| + void PlatformInitialize(); |
| + void PlatformCreateWindow(); |
| + void PlatformSetWebContents(const gfx::Size& initial_size, |
|
Sami
2017/02/10 13:53:11
Sorry for not noticing earlier, but something like
|
| + content::WebContents* web_contents); |
| protected: |
| - base::Callback<void(HeadlessBrowser*)> on_start_callback_; |
| - HeadlessBrowser::Options options_; |
| - HeadlessBrowserMainParts* browser_main_parts_; // Not owned. |
| - |
| +#if defined(USE_AURA) |
| // TODO(eseckler): Currently one window and one window_tree_host |
| // is used for all web contents. We should probably use one |
| // window per web contents, but additional investigation is needed. |
| - std::unique_ptr<aura::WindowTreeHost> window_tree_host_; |
| - std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_; |
| + std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_; |
| +#endif |
| + base::Callback<void(HeadlessBrowser*)> on_start_callback_; |
| + HeadlessBrowser::Options options_; |
| + HeadlessBrowserMainParts* browser_main_parts_; // Not owned. |
| std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>> |
| browser_contexts_; |