| 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 "ui/views/test/test_views_delegate.h" | 5 #include "ui/views/test/test_views_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" |
| 7 #include "base/logging.h" | 8 #include "base/logging.h" |
| 8 #include "content/public/test/web_contents_tester.h" | 9 #include "content/public/test/web_contents_tester.h" |
| 10 #include "ui/views/views_switches.h" |
| 11 #include "ui/views/widget/desktop_native_widget_aura.h" |
| 9 | 12 |
| 10 namespace views { | 13 namespace views { |
| 11 | 14 |
| 12 TestViewsDelegate::TestViewsDelegate() | 15 TestViewsDelegate::TestViewsDelegate() |
| 13 : use_transparent_windows_(false) { | 16 : use_transparent_windows_(false) { |
| 14 DCHECK(!ViewsDelegate::views_delegate); | 17 DCHECK(!ViewsDelegate::views_delegate); |
| 15 ViewsDelegate::views_delegate = this; | 18 ViewsDelegate::views_delegate = this; |
| 16 } | 19 } |
| 17 | 20 |
| 18 TestViewsDelegate::~TestViewsDelegate() { | 21 TestViewsDelegate::~TestViewsDelegate() { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 return NULL; | 58 return NULL; |
| 56 } | 59 } |
| 57 #endif | 60 #endif |
| 58 | 61 |
| 59 content::WebContents* TestViewsDelegate::CreateWebContents( | 62 content::WebContents* TestViewsDelegate::CreateWebContents( |
| 60 content::BrowserContext* browser_context, | 63 content::BrowserContext* browser_context, |
| 61 content::SiteInstance* site_instance) { | 64 content::SiteInstance* site_instance) { |
| 62 return NULL; | 65 return NULL; |
| 63 } | 66 } |
| 64 | 67 |
| 68 NativeWidget* TestViewsDelegate::CreateNativeWidget( |
| 69 internal::NativeWidgetDelegate* delegate, |
| 70 gfx::NativeView parent) { |
| 71 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWinAura)) |
| 72 return new DesktopNativeWidgetAura(delegate); |
| 73 return NULL; |
| 74 } |
| 75 |
| 65 } // namespace views | 76 } // namespace views |
| OLD | NEW |