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 { |
11 namespace test { | 11 namespace test { |
12 | 12 |
13 // A widget that assumes mouse capture always works. It won't in testing, so we | 13 // A widget that assumes mouse capture always works. It won't in testing, so we |
14 // mock it. | 14 // mock it. |
15 NativeWidgetCapture::NativeWidgetCapture( | 15 NativeWidgetCapture::NativeWidgetCapture( |
16 internal::NativeWidgetDelegate* delegate) | 16 internal::NativeWidgetDelegate* delegate) |
17 : NativeWidgetAura(delegate), | 17 : PlatformNativeWidget(delegate), |
18 mouse_capture_(false) {} | 18 mouse_capture_(false) {} |
| 19 |
19 NativeWidgetCapture::~NativeWidgetCapture() {} | 20 NativeWidgetCapture::~NativeWidgetCapture() {} |
20 | 21 |
21 void NativeWidgetCapture::SetCapture() { | 22 void NativeWidgetCapture::SetCapture() { |
22 mouse_capture_ = true; | 23 mouse_capture_ = true; |
23 } | 24 } |
24 | 25 |
25 void NativeWidgetCapture::ReleaseCapture() { | 26 void NativeWidgetCapture::ReleaseCapture() { |
26 if (mouse_capture_) | 27 if (mouse_capture_) |
27 delegate()->OnMouseCaptureLost(); | 28 delegate()->OnMouseCaptureLost(); |
28 mouse_capture_ = false; | 29 mouse_capture_ = false; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 View* WidgetTest::GetMouseMoveHandler(internal::RootView* root_view) { | 98 View* WidgetTest::GetMouseMoveHandler(internal::RootView* root_view) { |
98 return root_view->mouse_move_handler_; | 99 return root_view->mouse_move_handler_; |
99 } | 100 } |
100 | 101 |
101 View* WidgetTest::GetGestureHandler(internal::RootView* root_view) { | 102 View* WidgetTest::GetGestureHandler(internal::RootView* root_view) { |
102 return root_view->gesture_handler_; | 103 return root_view->gesture_handler_; |
103 } | 104 } |
104 | 105 |
105 } // namespace test | 106 } // namespace test |
106 } // namespace views | 107 } // namespace views |
OLD | NEW |