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 76acc0f4a5677de9571b4b1144d450a1afac3f57..a5e92e26e4a3aa342d4015090d1779297f4eab28 100644 |
--- a/headless/lib/browser/headless_browser_impl.h |
+++ b/headless/lib/browser/headless_browser_impl.h |
@@ -24,6 +24,21 @@ namespace headless { |
class HeadlessBrowserContextImpl; |
class HeadlessBrowserMainParts; |
+class HeadlessBrowserWindow { |
+ public: |
+ explicit HeadlessBrowserWindow(gfx::Size size); |
+ gfx::Rect bounds() const { return bounds_; } |
+ std::string state() const { return state_; } |
Sami
2017/05/22 16:30:57
nit: const ref
|
+ void set_bounds(gfx::Rect bounds) { bounds_ = bounds; } |
+ void set_state(std::string state); |
Sami
2017/05/22 16:30:57
nit: const ref
|
+ |
+ private: |
+ gfx::Rect bounds_; |
+ std::string state_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserWindow); |
+}; |
+ |
// Exported for tests. |
class HEADLESS_EXPORT HeadlessBrowserImpl : public HeadlessBrowser, |
public HeadlessDevToolsTarget { |
@@ -65,6 +80,7 @@ class HEADLESS_EXPORT HeadlessBrowserImpl : public HeadlessBrowser, |
void RunOnStartCallback(); |
HeadlessBrowser::Options* options() { return &options_; } |
+ HeadlessBrowserWindow* window() { return &window_; } |
HeadlessBrowserContext* CreateBrowserContext( |
HeadlessBrowserContext::Builder* builder); |
@@ -79,12 +95,15 @@ class HEADLESS_EXPORT HeadlessBrowserImpl : public HeadlessBrowser, |
// Helper for one time initialization of application |
void PlatformInitialize(); |
void PlatformCreateWindow(); |
- void PlatformInitializeWebContents(const gfx::Size& initial_size, |
+ void PlatformInitializeWebContents(const gfx::Size& initial_window_size, |
+ const gfx::Size& screen_size, |
HeadlessWebContentsImpl* web_contents); |
protected: |
base::Callback<void(HeadlessBrowser*)> on_start_callback_; |
HeadlessBrowser::Options options_; |
+ HeadlessBrowserWindow window_; |
+ |
HeadlessBrowserMainParts* browser_main_parts_; // Not owned. |
std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>> |