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/base/test/ui_controls.h" | 5 #include "ui/base/test/ui_controls.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "ui/base/test/ui_controls_internal_win.h" | 9 #include "ui/base/test/ui_controls_internal_win.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/geometry/point.h" |
11 | 11 |
12 namespace ui_controls { | 12 namespace ui_controls { |
13 bool g_ui_controls_enabled = false; | 13 bool g_ui_controls_enabled = false; |
14 | 14 |
15 void EnableUIControls() { | 15 void EnableUIControls() { |
16 g_ui_controls_enabled = true; | 16 g_ui_controls_enabled = true; |
17 } | 17 } |
18 | 18 |
19 bool SendKeyPress(gfx::NativeWindow window, | 19 bool SendKeyPress(gfx::NativeWindow window, |
20 ui::KeyboardCode key, | 20 ui::KeyboardCode key, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 CHECK(g_ui_controls_enabled); | 65 CHECK(g_ui_controls_enabled); |
66 return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure()); | 66 return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure()); |
67 } | 67 } |
68 | 68 |
69 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { | 69 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { |
70 // On windows, posting UI events is synchronous so just post the closure. | 70 // On windows, posting UI events is synchronous so just post the closure. |
71 base::MessageLoopForUI::current()->PostTask(FROM_HERE, closure); | 71 base::MessageLoopForUI::current()->PostTask(FROM_HERE, closure); |
72 } | 72 } |
73 | 73 |
74 } // namespace ui_controls | 74 } // namespace ui_controls |
OLD | NEW |