| 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/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const base::Closure& task) { | 59 const base::Closure& task) { |
| 60 CHECK(g_ui_controls_enabled); | 60 CHECK(g_ui_controls_enabled); |
| 61 return internal::SendMouseEventsImpl(type, state, task); | 61 return internal::SendMouseEventsImpl(type, state, task); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool SendMouseClick(MouseButton type) { | 64 bool SendMouseClick(MouseButton type) { |
| 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 bool SendTouchEvents(int action, int num, int x, int y) { |
| 70 CHECK(g_ui_controls_enabled); |
| 71 return internal::SendTouchEventsImpl(action, num, x, y); |
| 72 } |
| 73 |
| 69 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { | 74 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { |
| 70 // On windows, posting UI events is synchronous so just post the closure. | 75 // On windows, posting UI events is synchronous so just post the closure. |
| 71 base::MessageLoopForUI::current()->PostTask(FROM_HERE, closure); | 76 base::MessageLoopForUI::current()->PostTask(FROM_HERE, closure); |
| 72 } | 77 } |
| 73 | 78 |
| 74 } // namespace ui_controls | 79 } // namespace ui_controls |
| OLD | NEW |