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

Unified Diff: chrome/test/base/test_browser_window.h

Issue 1198313003: Fix the browser match rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert back to use Browesr raw pointer as the return type for CreateBrowserWithTestWindowForParams Created 5 years, 5 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
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_

Powered by Google App Engine
This is Rietveld 408576698