Chromium Code Reviews| 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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/task_runner.h" | 12 #include "base/task_runner.h" |
| 13 #include "ui/events/ozone/device/device_event_observer.h" | 13 #include "ui/events/ozone/device/device_event_observer.h" |
| 14 #include "ui/events/ozone/evdev/event_converter_evdev.h" | 14 #include "ui/events/ozone/evdev/event_converter_evdev.h" |
| 15 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" | 15 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" |
| 16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
| 17 #include "ui/events/ozone/evdev/keyboard_evdev.h" | 17 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
| 18 #include "ui/events/platform/platform_event_source.h" | 18 #include "ui/events/platform/platform_event_source.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 20 #include "ui/ozone/public/system_input_injector.h" | |
| 20 | 21 |
| 21 namespace gfx { | 22 namespace gfx { |
| 22 class PointF; | 23 class PointF; |
| 23 } // namespace gfx | 24 } // namespace gfx |
| 24 | 25 |
| 25 namespace ui { | 26 namespace ui { |
| 26 | 27 |
| 27 class CursorDelegateEvdev; | 28 class CursorDelegateEvdev; |
| 28 class DeviceManager; | 29 class DeviceManager; |
| 30 class SystemInputInjector; | |
| 29 | 31 |
| 30 #if defined(USE_EVDEV_GESTURES) | 32 #if defined(USE_EVDEV_GESTURES) |
| 31 class GesturePropertyProvider; | 33 class GesturePropertyProvider; |
| 32 #endif | 34 #endif |
| 33 | 35 |
| 34 // Ozone events implementation for the Linux input subsystem ("evdev"). | 36 // Ozone events implementation for the Linux input subsystem ("evdev"). |
| 35 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver, | 37 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver, |
| 36 public PlatformEventSource { | 38 public PlatformEventSource { |
| 37 public: | 39 public: |
| 38 EventFactoryEvdev(CursorDelegateEvdev* cursor, | 40 EventFactoryEvdev(CursorDelegateEvdev* cursor, |
| 39 DeviceManager* device_manager); | 41 DeviceManager* device_manager); |
| 40 ~EventFactoryEvdev() override; | 42 ~EventFactoryEvdev() override; |
| 41 | 43 |
| 42 void WarpCursorTo(gfx::AcceleratedWidget widget, | 44 void WarpCursorTo(gfx::AcceleratedWidget widget, |
| 43 const gfx::PointF& location); | 45 const gfx::PointF& location); |
| 44 | 46 |
| 47 scoped_ptr<SystemInputInjector> CreateSystemInputInjector(); | |
|
kelvinp
2014/11/25 04:43:08
Why CreateSystemInputInjector() instead of GetSyst
| |
| 48 | |
| 45 protected: | 49 protected: |
| 46 // DeviceEventObserver overrides: | 50 // DeviceEventObserver overrides: |
| 47 // | 51 // |
| 48 // Callback for device add (on UI thread). | 52 // Callback for device add (on UI thread). |
| 49 void OnDeviceEvent(const DeviceEvent& event) override; | 53 void OnDeviceEvent(const DeviceEvent& event) override; |
| 50 | 54 |
| 51 // PlatformEventSource: | 55 // PlatformEventSource: |
| 52 void OnDispatcherListChanged() override; | 56 void OnDispatcherListChanged() override; |
| 53 | 57 |
| 54 private: | 58 private: |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 103 |
| 100 // Support weak pointers for attach & detach callbacks. | 104 // Support weak pointers for attach & detach callbacks. |
| 101 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 105 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
| 102 | 106 |
| 103 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 107 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 } // namespace ui | 110 } // namespace ui |
| 107 | 111 |
| 108 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 112 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
| OLD | NEW |