OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/widget_test.h" | 5 #include "ui/views/test/widget_test.h" |
6 | 6 |
7 #include "ui/gfx/native_widget_types.h" | 7 #include "ui/gfx/native_widget_types.h" |
8 #include "ui/views/widget/root_view.h" | 8 #include "ui/views/widget/root_view.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 Widget* child = new Widget; | 65 Widget* child = new Widget; |
66 Widget::InitParams child_params = | 66 Widget::InitParams child_params = |
67 CreateParams(Widget::InitParams::TYPE_CONTROL); | 67 CreateParams(Widget::InitParams::TYPE_CONTROL); |
68 child_params.native_widget = CreatePlatformNativeWidget(child); | 68 child_params.native_widget = CreatePlatformNativeWidget(child); |
69 child_params.parent = parent_native_view; | 69 child_params.parent = parent_native_view; |
70 child->Init(child_params); | 70 child->Init(child_params); |
71 child->SetContentsView(new View); | 71 child->SetContentsView(new View); |
72 return child; | 72 return child; |
73 } | 73 } |
74 | 74 |
75 #if defined(OS_WIN) && !defined(USE_AURA) | |
76 // On Windows, it is possible for us to have a child window that is | |
77 // TYPE_POPUP. | |
78 Widget* WidgetTest::CreateChildPopupPlatformWidget( | |
79 gfx::NativeView parent_native_view) { | |
80 Widget* child = new Widget; | |
81 Widget::InitParams child_params = | |
82 CreateParams(Widget::InitParams::TYPE_POPUP); | |
83 child_params.child = true; | |
84 child_params.native_widget = CreatePlatformNativeWidget(child); | |
85 child_params.parent = parent_native_view; | |
86 child->Init(child_params); | |
87 child->SetContentsView(new View); | |
88 return child; | |
89 } | |
90 #endif | |
91 | |
92 Widget* WidgetTest::CreateTopLevelNativeWidget() { | 75 Widget* WidgetTest::CreateTopLevelNativeWidget() { |
93 Widget* toplevel = new Widget; | 76 Widget* toplevel = new Widget; |
94 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW); | 77 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW); |
95 toplevel->Init(params); | 78 toplevel->Init(params); |
96 return toplevel; | 79 return toplevel; |
97 } | 80 } |
98 | 81 |
99 Widget* WidgetTest::CreateChildNativeWidgetWithParent(Widget* parent) { | 82 Widget* WidgetTest::CreateChildNativeWidgetWithParent(Widget* parent) { |
100 Widget* child = new Widget; | 83 Widget* child = new Widget; |
101 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_CONTROL); | 84 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_CONTROL); |
(...skipping 14 matching lines...) Expand all Loading... |
116 View* WidgetTest::GetMouseMoveHandler(internal::RootView* root_view) { | 99 View* WidgetTest::GetMouseMoveHandler(internal::RootView* root_view) { |
117 return root_view->mouse_move_handler_; | 100 return root_view->mouse_move_handler_; |
118 } | 101 } |
119 | 102 |
120 View* WidgetTest::GetGestureHandler(internal::RootView* root_view) { | 103 View* WidgetTest::GetGestureHandler(internal::RootView* root_view) { |
121 return root_view->gesture_handler_; | 104 return root_view->gesture_handler_; |
122 } | 105 } |
123 | 106 |
124 } // namespace test | 107 } // namespace test |
125 } // namespace views | 108 } // namespace views |
OLD | NEW |