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..a301d5c02e35bc2b5a123d9f468445301188f29b 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,11 +196,48 @@ 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; |
| + |
| + Browser* CreateBrowser(const 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); |
| +#if defined(USE_AURA) |
| +// Helper that creates a browser which has a native aura window. It also handles |
| +// the lifetime of TestBrowserWindowAura. |
| +Browser* CreateBrowserWithAuraTestWindowForParams( |
| + const Browser::CreateParams& params); |
| + |
| +// Helper that creates a browser for a native aura window. It also handles the |
| +// lifetime of TestBrowserWindowAura. |
| +Browser* CreateBrowserForAuraTestWindowAndParams( |
|
msw
2015/07/08 23:58:00
Could we just have this single function, and calle
|
| + scoped_ptr<aura::Window> window, |
| + const Browser::CreateParams& params); |
| + |
| +#endif // defined(USE_AURA) |
| + |
| } // namespace chrome |
| #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |