Chromium Code Reviews| 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/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 #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.
| |
| 15 | 16 |
| 16 class LocationBarTesting; | 17 class LocationBarTesting; |
| 17 class OmniboxView; | 18 class OmniboxView; |
| 18 | 19 |
| 19 namespace extensions { | 20 namespace extensions { |
| 20 class Extension; | 21 class Extension; |
| 21 } | 22 } |
| 22 | 23 |
| 23 // An implementation of BrowserWindow used for testing. TestBrowserWindow only | 24 // An implementation of BrowserWindow used for testing. TestBrowserWindow only |
| 24 // contains a valid LocationBar, all other getters return NULL. | 25 // contains a valid LocationBar, all other getters return NULL. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); | 193 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 namespace chrome { | 196 namespace chrome { |
| 196 | 197 |
| 197 // Helper that handle the lifetime of TestBrowserWindow instances. | 198 // Helper that handle the lifetime of TestBrowserWindow instances. |
| 198 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); | 199 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params); |
| 199 | 200 |
| 200 } // namespace chrome | 201 } // namespace chrome |
| 201 | 202 |
| 203 #if defined(USE_AURA) | |
|
msw
2015/07/07 18:11:55
nit: order this before CreateBrowserWithTestWindow
xdai1
2015/07/08 00:26:22
Done.
| |
| 204 // 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.
| |
| 205 // it. | |
| 206 class TestBrowserWindowAura : public TestBrowserWindow { | |
| 207 public: | |
| 208 // |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.
| |
| 209 // was called. | |
| 210 explicit TestBrowserWindowAura(aura::Window* native_window); | |
| 211 ~TestBrowserWindowAura() override; | |
| 212 | |
| 213 // TestBrowserWindow overrides: | |
| 214 gfx::NativeWindow GetNativeWindow() const override; | |
| 215 void Show() override; | |
| 216 void Hide() override; | |
| 217 gfx::Rect GetBounds() const override; | |
| 218 | |
| 219 Browser* browser(); | |
| 220 void CreateBrowser(const Browser::CreateParams& params); | |
| 221 | |
| 222 private: | |
| 223 scoped_ptr<Browser> browser_; | |
| 224 scoped_ptr<aura::Window> native_window_; | |
| 225 | |
| 226 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowAura); | |
| 227 }; | |
| 228 | |
| 229 // 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.
| |
| 230 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.
| |
| 231 const Browser::CreateParams& params); | |
| 232 #endif // defined(USE_AURA) | |
| 233 | |
| 202 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ | 234 #endif // CHROME_TEST_BASE_TEST_BROWSER_WINDOW_H_ |
| OLD | NEW |