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 <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 void DisableInternalKeyboardExceptKeys( | 71 void DisableInternalKeyboardExceptKeys( |
72 scoped_ptr<std::set<DomCode>> excepted_keys); | 72 scoped_ptr<std::set<DomCode>> excepted_keys); |
73 | 73 |
74 // Enables all keys on the internal keyboard. | 74 // Enables all keys on the internal keyboard. |
75 void EnableInternalKeyboard(); | 75 void EnableInternalKeyboard(); |
76 | 76 |
77 scoped_ptr<SystemInputInjector> CreateSystemInputInjector(); | 77 scoped_ptr<SystemInputInjector> CreateSystemInputInjector(); |
78 | 78 |
79 InputController* input_controller() { return &input_controller_; } | 79 InputController* input_controller() { return &input_controller_; } |
80 | 80 |
81 // Post a key event to the unified keyboard (KeyboardEvdev). | 81 // Transitional accessors for testing. |
| 82 EventModifiersEvdev* modifiers() { return &modifiers_; } |
| 83 |
| 84 // Post events to UI. |
82 void PostKeyEvent(const KeyEventParams& params); | 85 void PostKeyEvent(const KeyEventParams& params); |
83 | 86 void PostMouseMoveEvent(const MouseMoveEventParams& params); |
84 // Post a touch event to UI. | 87 void PostMouseButtonEvent(const MouseButtonEventParams& params); |
85 void PostTouchEvent(const TouchEventParams& params); | 88 void PostTouchEvent(const TouchEventParams& params); |
86 | 89 |
87 protected: | 90 protected: |
88 // DeviceEventObserver overrides: | 91 // DeviceEventObserver overrides: |
89 // | 92 // |
90 // Callback for device add (on UI thread). | 93 // Callback for device add (on UI thread). |
91 void OnDeviceEvent(const DeviceEvent& event) override; | 94 void OnDeviceEvent(const DeviceEvent& event) override; |
92 | 95 |
93 // PlatformEventSource: | 96 // PlatformEventSource: |
94 void OnDispatcherListChanged() override; | 97 void OnDispatcherListChanged() override; |
95 | 98 |
96 private: | 99 private: |
97 // Post a task to dispatch an event. | 100 // Post a task to dispatch an event. |
98 void PostUiEvent(scoped_ptr<Event> event); | 101 virtual void PostUiEvent(scoped_ptr<Event> event); |
99 | 102 |
100 // Dispatch event via PlatformEventSource. | 103 // Dispatch event via PlatformEventSource. |
101 void DispatchUiEventTask(scoped_ptr<Event> event); | 104 void DispatchUiEventTask(scoped_ptr<Event> event); |
102 | 105 |
103 // Open device at path & starting processing events (on UI thread). | 106 // Open device at path & starting processing events (on UI thread). |
104 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); | 107 void AttachInputDevice(scoped_ptr<EventConverterEvdev> converter); |
105 | 108 |
106 // Close device at path (on UI thread). | 109 // Close device at path (on UI thread). |
107 void DetachInputDevice(const base::FilePath& file_path); | 110 void DetachInputDevice(const base::FilePath& file_path); |
108 | 111 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 153 |
151 // Support weak pointers for attach & detach callbacks. | 154 // Support weak pointers for attach & detach callbacks. |
152 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 155 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
153 | 156 |
154 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 157 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
155 }; | 158 }; |
156 | 159 |
157 } // namespace ui | 160 } // namespace ui |
158 | 161 |
159 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 162 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
OLD | NEW |