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 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class DeviceManager; | 28 class DeviceManager; |
29 | 29 |
30 // Ozone events implementation for the Linux input subsystem ("evdev"). | 30 // Ozone events implementation for the Linux input subsystem ("evdev"). |
31 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver, | 31 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver, |
32 public PlatformEventSource { | 32 public PlatformEventSource { |
33 public: | 33 public: |
34 EventFactoryEvdev(CursorDelegateEvdev* cursor, | 34 EventFactoryEvdev(CursorDelegateEvdev* cursor, |
35 DeviceManager* device_manager); | 35 DeviceManager* device_manager); |
36 virtual ~EventFactoryEvdev(); | 36 virtual ~EventFactoryEvdev(); |
37 | 37 |
38 void DispatchUiEvent(Event* event); | |
39 | |
40 void WarpCursorTo(gfx::AcceleratedWidget widget, | 38 void WarpCursorTo(gfx::AcceleratedWidget widget, |
41 const gfx::PointF& location); | 39 const gfx::PointF& location); |
42 | 40 |
43 private: | 41 private: |
| 42 // Post a task to dispatch an event. |
| 43 void PostUiEvent(scoped_ptr<Event> event); |
| 44 |
| 45 // Dispatch event via PlatformEventSource. |
| 46 void DispatchUiEventTask(scoped_ptr<Event> event); |
| 47 |
44 // Open device at path & starting processing events (on UI thread). | 48 // Open device at path & starting processing events (on UI thread). |
45 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); | 49 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); |
46 | 50 |
47 // Close device at path (on UI thread). | 51 // Close device at path (on UI thread). |
48 void DetachInputDevice(const base::FilePath& file_path); | 52 void DetachInputDevice(const base::FilePath& file_path); |
49 | 53 |
50 void NotifyHotplugEventObserver(const EventConverterEvdev& converter); | 54 void NotifyHotplugEventObserver(const EventConverterEvdev& converter); |
51 | 55 |
52 int NextDeviceId(); | 56 int NextDeviceId(); |
53 | 57 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 89 |
86 // Support weak pointers for attach & detach callbacks. | 90 // Support weak pointers for attach & detach callbacks. |
87 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 91 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
88 | 92 |
89 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 93 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
90 }; | 94 }; |
91 | 95 |
92 } // namespace ui | 96 } // namespace ui |
93 | 97 |
94 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 98 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
OLD | NEW |