OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 |
| 11 namespace base { |
| 12 class Thread; |
| 13 } |
| 14 |
| 15 namespace ui { |
| 16 |
| 17 class CursorDelegateEvdev; |
| 18 class DeviceEventDispatcherEvdev; |
| 19 class InputDeviceFactoryProxyEvdev; |
| 20 |
| 21 typedef base::Callback<void(scoped_ptr<InputDeviceFactoryProxyEvdev>)> |
| 22 EventThreadStartCallback; |
| 23 |
| 24 // Wrapper for events thread. |
| 25 class EventThreadEvdev { |
| 26 public: |
| 27 EventThreadEvdev(); |
| 28 ~EventThreadEvdev(); |
| 29 |
| 30 // Start a new events thread. All device events will get sent to the |
| 31 // passed dispatcher. The thread will call directly into cursor, so it |
| 32 // must be synchronized accordingly. |
| 33 void Start(scoped_ptr<DeviceEventDispatcherEvdev> dispatcher, |
| 34 CursorDelegateEvdev* cursor, |
| 35 const EventThreadStartCallback& callback); |
| 36 |
| 37 private: |
| 38 // Post a task to dispatch an event. |
| 39 scoped_ptr<base::Thread> thread_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(EventThreadEvdev); |
| 42 }; |
| 43 |
| 44 } // namespace ui |
| 45 |
| 46 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_ |
OLD | NEW |