| 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 #include "chrome/test/base/test_browser_window.h" | 5 #include "chrome/test/base/test_browser_window.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
| 8 #include "chrome/browser/ui/browser_list_observer.h" | 8 #include "chrome/browser/ui/browser_list_observer.h" |
| 9 #include "ui/gfx/geometry/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
| 10 | 10 |
| 11 #if defined(OS_WIN) |
| 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 13 #endif // defined(OS_WIN) |
| 11 | 14 |
| 12 // Helpers -------------------------------------------------------------------- | 15 // Helpers -------------------------------------------------------------------- |
| 13 | 16 |
| 14 namespace chrome { | 17 namespace chrome { |
| 15 | 18 |
| 16 namespace { | 19 namespace { |
| 17 | 20 |
| 18 // Handles destroying a TestBrowserWindow when the Browser it is attached to is | 21 // Handles destroying a TestBrowserWindow when the Browser it is attached to is |
| 19 // destroyed. | 22 // destroyed. |
| 20 class TestBrowserWindowOwner : public chrome::BrowserListObserver { | 23 class TestBrowserWindowOwner : public chrome::BrowserListObserver { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 } | 35 } |
| 33 | 36 |
| 34 scoped_ptr<TestBrowserWindow> window_; | 37 scoped_ptr<TestBrowserWindow> window_; |
| 35 | 38 |
| 36 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowOwner); | 39 DISALLOW_COPY_AND_ASSIGN(TestBrowserWindowOwner); |
| 37 }; | 40 }; |
| 38 | 41 |
| 39 } // namespace | 42 } // namespace |
| 40 | 43 |
| 41 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params) { | 44 Browser* CreateBrowserWithTestWindowForParams(Browser::CreateParams* params) { |
| 45 #if defined(OS_WIN) |
| 46 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 47 #endif // defined(OS_WIN) |
| 42 TestBrowserWindow* window = new TestBrowserWindow; | 48 TestBrowserWindow* window = new TestBrowserWindow; |
| 43 new TestBrowserWindowOwner(window); | 49 new TestBrowserWindowOwner(window); |
| 44 params->window = window; | 50 params->window = window; |
| 45 return new Browser(*params); | 51 return new Browser(*params); |
| 46 } | 52 } |
| 47 | 53 |
| 48 } // namespace chrome | 54 } // namespace chrome |
| 49 | 55 |
| 50 | 56 |
| 51 // TestBrowserWindow::TestLocationBar ----------------------------------------- | 57 // TestBrowserWindow::TestLocationBar ----------------------------------------- |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 230 } |
| 225 | 231 |
| 226 int | 232 int |
| 227 TestBrowserWindow::GetRenderViewHeightInsetWithDetachedBookmarkBar() { | 233 TestBrowserWindow::GetRenderViewHeightInsetWithDetachedBookmarkBar() { |
| 228 return 0; | 234 return 0; |
| 229 } | 235 } |
| 230 | 236 |
| 231 void TestBrowserWindow::ExecuteExtensionCommand( | 237 void TestBrowserWindow::ExecuteExtensionCommand( |
| 232 const extensions::Extension* extension, | 238 const extensions::Extension* extension, |
| 233 const extensions::Command& command) {} | 239 const extensions::Command& command) {} |
| OLD | NEW |