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

Side by Side 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 msw@'s comments. 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 unified diff | Download patch
OLDNEW
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/download/test_download_shelf.h" 11 #include "chrome/browser/download/test_download_shelf.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_window.h" 13 #include "chrome/browser/ui/browser_window.h"
14 #include "chrome/browser/ui/location_bar/location_bar.h" 14 #include "chrome/browser/ui/location_bar/location_bar.h"
15 15
16 #if defined(USE_AURA)
17 #include "ui/aura/window.h"
18 #endif
19
16 class LocationBarTesting; 20 class LocationBarTesting;
17 class OmniboxView; 21 class OmniboxView;
18 22
19 namespace extensions { 23 namespace extensions {
20 class Extension; 24 class Extension;
21 } 25 }
22 26
23 // An implementation of BrowserWindow used for testing. TestBrowserWindow only 27 // An implementation of BrowserWindow used for testing. TestBrowserWindow only
24 // contains a valid LocationBar, all other getters return NULL. 28 // contains a valid LocationBar, all other getters return NULL.
25 // See BrowserWithTestWindowTest for an example of using this class. 29 // See BrowserWithTestWindowTest for an example of using this class.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 private: 189 private:
186 DISALLOW_COPY_AND_ASSIGN(TestLocationBar); 190 DISALLOW_COPY_AND_ASSIGN(TestLocationBar);
187 }; 191 };
188 192
189 TestDownloadShelf download_shelf_; 193 TestDownloadShelf download_shelf_;
190 TestLocationBar location_bar_; 194 TestLocationBar location_bar_;
191 195
192 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); 196 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow);
193 }; 197 };
194 198
199 #if defined(USE_AURA)
200 // A browser window proxy with an associated Aura native window.
201 class TestBrowserWindowAura : public TestBrowserWindow {
202 public:
203 explicit TestBrowserWindowAura(aura::Window* native_window);
204 ~TestBrowserWindowAura() override;
205
206 // TestBrowserWindow overrides:
207 gfx::NativeWindow GetNativeWindow() const override;
208 void Show() override;
209 void Hide() override;
210 gfx::Rect GetBounds() const override;
211
212 Browser* browser();
213 void CreateBrowser(const Browser::CreateParams& params);
214
215 private:
216 Browser* browser_; // not owned
217 scoped_ptr<aura::Window> native_window_;
218
219 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura);
220 };
221 #endif // defined(USE_AURA)
222
195 namespace chrome { 223 namespace chrome {
196 224
197 // Helper that handle the lifetime of TestBrowserWindow instances. 225 // Helper that handle the lifetime of TestBrowserWindow instances.
198 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); 226 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params);
199 227
228 #if defined(USE_AURA)
229 // Helper that creates a test browser window which has a native window.
230 Browser* CreateBrowserWithAuraTestWindowForParams(
231 const Browser::CreateParams& params);
232 #endif // defined(USE_AURA)
233
200 } // namespace chrome 234 } // namespace chrome
201 235
202 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ 236 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698