Chromium Code Reviews| Index: chrome/test/base/test_browser_window.h |
| diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h |
| index 57c43fa41ddf20d85c4f415bc22f74a33f5d8c5b..911f246c1b19afe7d886fdce46714ab5a377d7a5 100644 |
| --- a/chrome/test/base/test_browser_window.h |
| +++ b/chrome/test/base/test_browser_window.h |
| @@ -13,6 +13,10 @@ |
| #include "chrome/browser/ui/browser_window.h" |
| #include "chrome/browser/ui/location_bar/location_bar.h" |
| +#if defined(USE_AURA) |
| +#include "ui/aura/window.h" |
| +#endif |
| + |
| class LocationBarTesting; |
| class OmniboxView; |
| @@ -192,10 +196,44 @@ class TestBrowserWindow : public BrowserWindow { |
| DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); |
| }; |
| +#if defined(USE_AURA) |
| +// A browser window proxy with an associated Aura native window. |
| +class TestBrowserWindowAura : public TestBrowserWindow { |
| + public: |
| + explicit TestBrowserWindowAura(scoped_ptr<aura::Window> native_window); |
| + ~TestBrowserWindowAura() override; |
| + |
| + // TestBrowserWindow overrides: |
| + gfx::NativeWindow GetNativeWindow() const override; |
| + void Show() override; |
| + void Hide() override; |
| + gfx::Rect GetBounds() const override; |
| + |
| + scoped_ptr<Browser> CreateBrowser(Browser::CreateParams* params); |
| + |
| + private: |
| + Browser* browser_; // not owned |
| + scoped_ptr<aura::Window> native_window_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura); |
| +}; |
| +#endif // defined(USE_AURA) |
| + |
| namespace chrome { |
| // Helper that handle the lifetime of TestBrowserWindow instances. |
| -Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); |
| +scoped_ptr<Browser> CreateBrowserWithTestWindowForParams( |
| + Browser::CreateParams* params); |
| + |
| +#if defined(USE_AURA) |
| +// Helper that creates a browser with a native aura |window|. If |window| is |
|
msw
2015/07/09 22:37:37
nit: capitalize Aura
xdai1
2015/07/09 23:45:40
Done.
|
| +// nullptr, it will create an aura window to associate with the browser. It also |
|
msw
2015/07/09 22:37:37
nit: capitalize Aura
xdai1
2015/07/09 23:45:40
Done.
|
| +// handles the lifetime of TestBrowserWindowAura. |
| +scoped_ptr<Browser> CreateBrowserWithAuraTestWindowForParams( |
| + scoped_ptr<aura::Window> window, |
| + Browser::CreateParams* params); |
| + |
| +#endif // defined(USE_AURA) |
| } // namespace chrome |