| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/widget/native_widget_test_utils.h" | 5 #include "ui/views/widget/native_widget_test_utils.h" |
| 6 | 6 |
| 7 #include "ui/views/view.h" |
| 7 #include "ui/views/widget/native_widget_private.h" | 8 #include "ui/views/widget/native_widget_private.h" |
| 8 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
| 9 #include "views/view.h" | |
| 10 | 10 |
| 11 namespace views { | 11 namespace views { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 NativeWidgetPrivate* CreateNativeWidgetOfType(Widget::InitParams::Type type) { | 16 NativeWidgetPrivate* CreateNativeWidgetOfType(Widget::InitParams::Type type) { |
| 17 Widget* widget = new Widget; | 17 Widget* widget = new Widget; |
| 18 Widget::InitParams params(type); | 18 Widget::InitParams params(type); |
| 19 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; | 19 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; |
| 20 params.bounds = gfx::Rect(10, 10, 200, 200); | 20 params.bounds = gfx::Rect(10, 10, 200, 200); |
| 21 widget->Init(params); | 21 widget->Init(params); |
| 22 return widget->native_widget_private(); | 22 return widget->native_widget_private(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 NativeWidgetPrivate* CreateNativeWidget() { | 27 NativeWidgetPrivate* CreateNativeWidget() { |
| 28 return CreateNativeWidgetOfType(Widget::InitParams::TYPE_POPUP); | 28 return CreateNativeWidgetOfType(Widget::InitParams::TYPE_POPUP); |
| 29 } | 29 } |
| 30 | 30 |
| 31 NativeWidgetPrivate* CreateNativeSubWidget() { | 31 NativeWidgetPrivate* CreateNativeSubWidget() { |
| 32 return CreateNativeWidgetOfType(Widget::InitParams::TYPE_CONTROL); | 32 return CreateNativeWidgetOfType(Widget::InitParams::TYPE_CONTROL); |
| 33 } | 33 } |
| 34 | 34 |
| 35 } // namespace internal | 35 } // namespace internal |
| 36 } // namespace ui | 36 } // namespace ui |
| OLD | NEW |