OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
6 #define CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 6 #define CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 private: | 184 private: |
185 DISALLOW_COPY_AND_ASSIGN(TestLocationBar); | 185 DISALLOW_COPY_AND_ASSIGN(TestLocationBar); |
186 }; | 186 }; |
187 | 187 |
188 TestDownloadShelf download_shelf_; | 188 TestDownloadShelf download_shelf_; |
189 TestLocationBar location_bar_; | 189 TestLocationBar location_bar_; |
190 | 190 |
191 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); | 191 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); |
192 }; | 192 }; |
193 | 193 |
| 194 // Handles destroying a TestBrowserWindow when the Browser it is attached to is |
| 195 // destroyed. |
| 196 class TestBrowserWindowOwner : public chrome::BrowserListObserver { |
| 197 public: |
| 198 explicit TestBrowserWindowOwner(TestBrowserWindow* window); |
| 199 ~TestBrowserWindowOwner() override; |
| 200 |
| 201 private: |
| 202 // Overridden from BrowserListObserver: |
| 203 void OnBrowserRemoved(Browser* browser) override; |
| 204 scoped_ptr<TestBrowserWindow> window_; |
| 205 |
| 206 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowOwner); |
| 207 }; |
| 208 |
194 namespace chrome { | 209 namespace chrome { |
195 | 210 |
196 // Helper that handle the lifetime of TestBrowserWindow instances. | 211 // Helper that handle the lifetime of TestBrowserWindow instances. |
197 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); | 212 scoped_ptr<Browser> CreateBrowserWithTestWindowForParams( |
| 213 Browser::CreateParams* params); |
198 | 214 |
199 } // namespace chrome | 215 } // namespace chrome |
200 | 216 |
201 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 217 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
OLD | NEW |