| 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/desktop_test_views_delegate.h" | 5 #include "ui/views/test/desktop_test_views_delegate.h" |
| 6 | 6 |
| 7 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 7 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 8 #include "ui/views/widget/native_widget_aura.h" | 8 #include "ui/views/widget/native_widget_aura.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| 11 | 11 |
| 12 DesktopTestViewsDelegate::DesktopTestViewsDelegate() {} | 12 DesktopTestViewsDelegate::DesktopTestViewsDelegate() {} |
| 13 | 13 |
| 14 DesktopTestViewsDelegate::~DesktopTestViewsDelegate() {} | 14 DesktopTestViewsDelegate::~DesktopTestViewsDelegate() {} |
| 15 | 15 |
| 16 NativeWidget* DesktopTestViewsDelegate::CreateNativeWidget( | 16 void DesktopTestViewsDelegate::OnWidgetInit( |
| 17 Widget::InitParams::Type type, | 17 Widget::InitParams* params, |
| 18 internal::NativeWidgetDelegate* delegate, | 18 internal::NativeWidgetDelegate* delegate) { |
| 19 gfx::NativeView parent, | |
| 20 gfx::NativeView context) { | |
| 21 #if defined(USE_AURA) && !defined(OS_CHROMEOS) | 19 #if defined(USE_AURA) && !defined(OS_CHROMEOS) |
| 22 if (parent && type != views::Widget::InitParams::TYPE_MENU) | 20 if (params->parent && params->type != views::Widget::InitParams::TYPE_MENU) { |
| 23 return new views::NativeWidgetAura(delegate); | 21 params->native_widget = new views::NativeWidgetAura(delegate); |
| 24 | 22 } else if (!params->parent && !params->context) { |
| 25 if (!parent && !context) | 23 params->native_widget = new views::DesktopNativeWidgetAura(delegate); |
| 26 return new views::DesktopNativeWidgetAura(delegate); | 24 } |
| 27 #endif | 25 #endif |
| 28 | |
| 29 return NULL; | |
| 30 } | 26 } |
| 31 | 27 |
| 32 } // namespace views | 28 } // namespace views |
| OLD | NEW |