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" |
| 11 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
12 #include "chrome/test/base/test_location_bar.h" | 13 #include "chrome/test/base/test_location_bar.h" |
13 | 14 |
14 namespace extensions { | 15 namespace extensions { |
15 class Extension; | 16 class Extension; |
16 } | 17 } |
17 | 18 |
18 // An implementation of BrowserWindow used for testing. TestBrowserWindow only | 19 // An implementation of BrowserWindow used for testing. TestBrowserWindow only |
19 // contains a valid LocationBar, all other getters return NULL. | 20 // contains a valid LocationBar, all other getters return NULL. |
20 // See BrowserWithTestWindowTest for an example of using this class. | 21 // See BrowserWithTestWindowTest for an example of using this class. |
21 class TestBrowserWindow : public BrowserWindow { | 22 class TestBrowserWindow : public BrowserWindow { |
22 public: | 23 public: |
23 explicit TestBrowserWindow(Browser* browser); | 24 TestBrowserWindow(); |
24 virtual ~TestBrowserWindow(); | 25 virtual ~TestBrowserWindow(); |
25 | 26 |
26 // BrowserWindow: | 27 // BrowserWindow: |
27 virtual void Show() OVERRIDE {} | 28 virtual void Show() OVERRIDE {} |
28 virtual void ShowInactive() OVERRIDE {} | 29 virtual void ShowInactive() OVERRIDE {} |
29 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {} | 30 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {} |
30 virtual void Close() OVERRIDE {} | 31 virtual void Close() OVERRIDE {} |
31 virtual void Activate() OVERRIDE {} | 32 virtual void Activate() OVERRIDE {} |
32 virtual void Deactivate() OVERRIDE {} | 33 virtual void Deactivate() OVERRIDE {} |
33 virtual bool IsActive() const OVERRIDE; | 34 virtual bool IsActive() const OVERRIDE; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 144 |
144 protected: | 145 protected: |
145 virtual void DestroyBrowser() OVERRIDE {} | 146 virtual void DestroyBrowser() OVERRIDE {} |
146 | 147 |
147 private: | 148 private: |
148 TestLocationBar location_bar_; | 149 TestLocationBar location_bar_; |
149 | 150 |
150 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); | 151 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); |
151 }; | 152 }; |
152 | 153 |
| 154 namespace chrome { |
| 155 |
| 156 // Helpers that handle the lifetime of TestBrowserWindow instances. |
| 157 Browser* CreateBrowserWithTestWindowForProfile(Profile* profile); |
| 158 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); |
| 159 |
| 160 } // namespace chrome |
| 161 |
153 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 162 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
OLD | NEW |