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

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: Address sky@'s comment. 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | chrome/test/base/test_browser_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e3411675aac8e51774d10d459a9be080603d2eee..e97473a64d5ed4c6014039f6bd28ba1c11d9a789 100644
--- a/chrome/test/base/test_browser_window.h
+++ b/chrome/test/base/test_browser_window.h
@@ -191,10 +191,26 @@ class TestBrowserWindow : public BrowserWindow {
DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow);
};
+// Handles destroying a TestBrowserWindow when the Browser it is attached to is
+// destroyed.
+class TestBrowserWindowOwner : public chrome::BrowserListObserver {
+ public:
+ explicit TestBrowserWindowOwner(TestBrowserWindow* window);
+ ~TestBrowserWindowOwner() override;
+
+ private:
+ // Overridden from BrowserListObserver:
+ void OnBrowserRemoved(Browser* browser) override;
+ scoped_ptr<TestBrowserWindow> window_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowOwner);
+};
+
namespace chrome {
// Helper that handle the lifetime of TestBrowserWindow instances.
-Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params);
+scoped_ptr<Browser> CreateBrowserWithTestWindowForParams(
+ Browser::CreateParams* params);
} // namespace chrome
« no previous file with comments | « chrome/test/BUILD.gn ('k') | chrome/test/base/test_browser_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698