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

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: 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..6834d16586b441f385ed622f3579ee8bc9a8aa06 100644
--- a/chrome/test/base/test_browser_window.h
+++ b/chrome/test/base/test_browser_window.h
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/location_bar/location_bar.h"
+#include "ui/aura/window.h"
msw 2015/07/07 18:11:55 nit: limit to #if defined(USE_AURA) (or add test_b
xdai1 2015/07/08 00:26:22 Done.
class LocationBarTesting;
class OmniboxView;
@@ -199,4 +200,35 @@ Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params);
} // namespace chrome
+#if defined(USE_AURA)
msw 2015/07/07 18:11:55 nit: order this before CreateBrowserWithTestWindow
xdai1 2015/07/08 00:26:22 Done.
+// A browser window proxy which is able to associate an aura native window with
msw 2015/07/07 18:11:55 nit: // A browser window proxy with an associated
xdai1 2015/07/08 00:26:21 Done.
+// it.
+class TestBrowserWindowAura : public TestBrowserWindow {
+ public:
+ // |native_window| will still be owned by the caller after the constructor
msw 2015/07/07 18:11:55 nit: // The caller retains ownership of |native_wi
xdai1 2015/07/08 00:26:22 Sorry I think I made a mistake here. I think |nati
msw 2015/07/08 01:14:00 Ah, that does seem to be the case.
+ // was called.
+ explicit TestBrowserWindowAura(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* browser();
+ void CreateBrowser(const Browser::CreateParams& params);
+
+ private:
+ scoped_ptr<Browser> browser_;
+ scoped_ptr<aura::Window> native_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura);
+};
+
+// Helper that create a test browser window which has a native window.
msw 2015/07/07 18:11:55 nit: creates
xdai1 2015/07/08 00:26:21 Done.
+scoped_ptr<TestBrowserWindowAura> CreateBrowserWithNativeWindowForParams(
msw 2015/07/07 18:11:55 nit: maybe return a Browser* like CreateBrowserWit
msw 2015/07/07 18:11:55 nit: move this into the chrome namespace, and orde
xdai1 2015/07/08 00:26:22 Done.
xdai1 2015/07/08 00:26:22 Done.
+ const Browser::CreateParams& params);
+#endif // defined(USE_AURA)
+
#endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_

Powered by Google App Engine
This is Rietveld 408576698