OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/aura/client/focus_client.h" |
7 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
8 #include "ui/aura/window_tree_host.h" | 9 #include "ui/aura/window_tree_host.h" |
9 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
10 | 11 |
11 namespace views { | 12 namespace views { |
12 namespace test { | 13 namespace test { |
13 | 14 |
14 // static | 15 // static |
15 void WidgetTest::SimulateNativeDestroy(Widget* widget) { | 16 void WidgetTest::SimulateNativeDestroy(Widget* widget) { |
16 delete widget->GetNativeView(); | 17 delete widget->GetNativeView(); |
17 } | 18 } |
18 | 19 |
19 // static | 20 // static |
20 bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) { | 21 bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) { |
21 return window->IsVisible(); | 22 return window->IsVisible(); |
22 } | 23 } |
23 | 24 |
24 // static | 25 // static |
25 ui::EventProcessor* WidgetTest::GetEventProcessor(Widget* widget) { | 26 ui::EventProcessor* WidgetTest::GetEventProcessor(Widget* widget) { |
26 return widget->GetNativeWindow()->GetHost()->event_processor(); | 27 return widget->GetNativeWindow()->GetHost()->event_processor(); |
27 } | 28 } |
28 | 29 |
| 30 // static |
| 31 gfx::NativeWindow WidgetTest::CurrentlyFocussedWindow(Widget* widget_context) { |
| 32 return aura::client::GetFocusClient(widget_context->GetNativeWindow()) |
| 33 ->GetFocusedWindow(); |
| 34 } |
| 35 |
29 } // namespace test | 36 } // namespace test |
30 } // namespace views | 37 } // namespace views |
OLD | NEW |