| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 protected: | 81 protected: |
| 82 // DeviceEventObserver overrides: | 82 // DeviceEventObserver overrides: |
| 83 // | 83 // |
| 84 // Callback for device add (on UI thread). | 84 // Callback for device add (on UI thread). |
| 85 void OnDeviceEvent(const DeviceEvent& event) override; | 85 void OnDeviceEvent(const DeviceEvent& event) override; |
| 86 | 86 |
| 87 // PlatformEventSource: | 87 // PlatformEventSource: |
| 88 void OnDispatcherListChanged() override; | 88 void OnDispatcherListChanged() override; |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 // Post a task to dispatch an event. | |
| 92 virtual void PostUiEvent(scoped_ptr<Event> event); | |
| 93 | |
| 94 // Dispatch event via PlatformEventSource. | 91 // Dispatch event via PlatformEventSource. |
| 95 void DispatchUiEventTask(scoped_ptr<Event> event); | 92 void DispatchUiEvent(ui::Event* event); |
| 96 | 93 |
| 97 int NextDeviceId(); | 94 int NextDeviceId(); |
| 98 | 95 |
| 99 // Used to uniquely identify input devices. | 96 // Used to uniquely identify input devices. |
| 100 int last_device_id_; | 97 int last_device_id_; |
| 101 | 98 |
| 102 // Interface for scanning & monitoring input devices. | 99 // Interface for scanning & monitoring input devices. |
| 103 DeviceManager* device_manager_; // Not owned. | 100 DeviceManager* device_manager_; // Not owned. |
| 104 | 101 |
| 105 // Factory for per-device objects. | 102 // Factory for per-device objects. |
| 106 scoped_ptr<InputDeviceFactoryEvdev> input_device_factory_; | 103 scoped_ptr<InputDeviceFactoryEvdev> input_device_factory_; |
| 107 | 104 |
| 108 // Dispatch callback for events. | |
| 109 EventDispatchCallback dispatch_callback_; | |
| 110 | |
| 111 // Modifier key state (shift, ctrl, etc). | 105 // Modifier key state (shift, ctrl, etc). |
| 112 EventModifiersEvdev modifiers_; | 106 EventModifiersEvdev modifiers_; |
| 113 | 107 |
| 114 // Mouse button map. | 108 // Mouse button map. |
| 115 MouseButtonMapEvdev button_map_; | 109 MouseButtonMapEvdev button_map_; |
| 116 | 110 |
| 117 // Keyboard state. | 111 // Keyboard state. |
| 118 KeyboardEvdev keyboard_; | 112 KeyboardEvdev keyboard_; |
| 119 | 113 |
| 120 // Cursor movement. | 114 // Cursor movement. |
| 121 CursorDelegateEvdev* cursor_; | 115 CursorDelegateEvdev* cursor_; |
| 122 | 116 |
| 123 // Object for controlling input devices. | 117 // Object for controlling input devices. |
| 124 InputControllerEvdev input_controller_; | 118 InputControllerEvdev input_controller_; |
| 125 | 119 |
| 126 // Whether we've set up the device factory & done initial scan. | 120 // Whether we've set up the device factory & done initial scan. |
| 127 bool initialized_; | 121 bool initialized_; |
| 128 | 122 |
| 129 // Support weak pointers for attach & detach callbacks. | 123 // Support weak pointers for attach & detach callbacks. |
| 130 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 124 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
| 131 | 125 |
| 132 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 126 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
| 133 }; | 127 }; |
| 134 | 128 |
| 135 } // namespace ui | 129 } // namespace ui |
| 136 | 130 |
| 137 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 131 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
| OLD | NEW |