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_INPUT_INJECTOR_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_INJECTOR_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_INJECTOR_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_INJECTOR_EVDEV_H_ |
7 | 7 |
8 #include "ui/events/ozone/evdev/event_dispatch_callback.h" | 8 #include "ui/events/ozone/evdev/event_dispatch_callback.h" |
9 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 9 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
10 #include "ui/ozone/public/system_input_injector.h" | 10 #include "ui/ozone/public/system_input_injector.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 class Event; | 14 class Event; |
15 class CursorDelegateEvdev; | 15 class CursorDelegateEvdev; |
16 class KeyboardEvdev; | 16 class DeviceEventDispatcherEvdev; |
17 class EventModifiersEvdev; | |
18 | 17 |
19 class EVENTS_OZONE_EVDEV_EXPORT InputInjectorEvdev | 18 class EVENTS_OZONE_EVDEV_EXPORT InputInjectorEvdev |
20 : public SystemInputInjector { | 19 : public SystemInputInjector { |
21 public: | 20 public: |
22 InputInjectorEvdev(EventModifiersEvdev* modifiers, | 21 InputInjectorEvdev(scoped_ptr<DeviceEventDispatcherEvdev> dispatcher, |
23 CursorDelegateEvdev* cursor, | 22 CursorDelegateEvdev* cursor); |
24 KeyboardEvdev* keyboard, | |
25 const EventDispatchCallback& callback); | |
26 | 23 |
27 ~InputInjectorEvdev() override; | 24 ~InputInjectorEvdev() override; |
28 | 25 |
29 // SystemInputInjector implementation. | 26 // SystemInputInjector implementation. |
30 void InjectMouseButton(EventFlags button, bool down) override; | 27 void InjectMouseButton(EventFlags button, bool down) override; |
31 void InjectMouseWheel(int delta_x, int delta_y) override; | 28 void InjectMouseWheel(int delta_x, int delta_y) override; |
32 void MoveCursorTo(const gfx::PointF& location) override; | 29 void MoveCursorTo(const gfx::PointF& location) override; |
33 void InjectKeyPress(DomCode physical_key, bool down) override; | 30 void InjectKeyPress(DomCode physical_key, bool down) override; |
34 | 31 |
35 private: | 32 private: |
36 // Modifier key state (shift, ctrl, etc). | |
37 EventModifiersEvdev* modifiers_; | |
38 | |
39 // Shared cursor state. | 33 // Shared cursor state. |
40 CursorDelegateEvdev* cursor_; | 34 CursorDelegateEvdev* cursor_; |
41 | 35 |
42 // Shared keyboard state. | 36 // Interface for dispatching events. |
43 KeyboardEvdev* keyboard_; | 37 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher_; |
44 | |
45 // Callback for dispatching events. | |
46 EventDispatchCallback callback_; | |
47 | 38 |
48 DISALLOW_COPY_AND_ASSIGN(InputInjectorEvdev); | 39 DISALLOW_COPY_AND_ASSIGN(InputInjectorEvdev); |
49 }; | 40 }; |
50 | 41 |
51 } // namespace ui | 42 } // namespace ui |
52 | 43 |
53 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_INJECTOR_EVDEV_H_ | 44 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_INJECTOR_EVDEV_H_ |
54 | 45 |
OLD | NEW |