Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: ui/events/ozone/evdev/input_device_factory_evdev.h

Issue 874723002: [PATCH 9/11] ozone: evdev: Add a device event dispatcher that forwards to UI thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_DEVICE_FACTORY_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 18 matching lines...) Expand all
29 29
30 #if defined(USE_EVDEV_GESTURES) 30 #if defined(USE_EVDEV_GESTURES)
31 class GesturePropertyProvider; 31 class GesturePropertyProvider;
32 #endif 32 #endif
33 33
34 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; 34 typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply;
35 35
36 // Manager for event device objects. All device I/O starts here. 36 // Manager for event device objects. All device I/O starts here.
37 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdev { 37 class EVENTS_OZONE_EVDEV_EXPORT InputDeviceFactoryEvdev {
38 public: 38 public:
39 InputDeviceFactoryEvdev( 39 InputDeviceFactoryEvdev(scoped_ptr<DeviceEventDispatcherEvdev> dispatcher,
40 DeviceEventDispatcherEvdev* dispatcher, 40 CursorDelegateEvdev* cursor);
41 scoped_refptr<base::SingleThreadTaskRunner> dispatch_runner,
42 CursorDelegateEvdev* cursor);
43 ~InputDeviceFactoryEvdev(); 41 ~InputDeviceFactoryEvdev();
44 42
45 // Open & start reading a newly plugged-in input device. 43 // Open & start reading a newly plugged-in input device.
46 void AddInputDevice(int id, const base::FilePath& path); 44 void AddInputDevice(int id, const base::FilePath& path);
47 45
48 // Stop reading & close an unplugged input device. 46 // Stop reading & close an unplugged input device.
49 void RemoveInputDevice(const base::FilePath& path); 47 void RemoveInputDevice(const base::FilePath& path);
50 48
51 // Disables the internal touchpad. 49 // Disables the internal touchpad.
52 void DisableInternalTouchpad(); 50 void DisableInternalTouchpad();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void SetIntPropertyForOneType(const EventDeviceType type, 86 void SetIntPropertyForOneType(const EventDeviceType type,
89 const std::string& name, 87 const std::string& name,
90 int value); 88 int value);
91 void SetBoolPropertyForOneType(const EventDeviceType type, 89 void SetBoolPropertyForOneType(const EventDeviceType type,
92 const std::string& name, 90 const std::string& name,
93 bool value); 91 bool value);
94 92
95 // Owned per-device event converters (by path). 93 // Owned per-device event converters (by path).
96 std::map<base::FilePath, EventConverterEvdev*> converters_; 94 std::map<base::FilePath, EventConverterEvdev*> converters_;
97 95
98 // Task runner for event dispatch. 96 // Task runner for our thread.
99 scoped_refptr<base::TaskRunner> ui_task_runner_; 97 scoped_refptr<base::TaskRunner> task_runner_;
100 98
101 // Cursor movement. 99 // Cursor movement.
102 CursorDelegateEvdev* cursor_; 100 CursorDelegateEvdev* cursor_;
103 101
104 #if defined(USE_EVDEV_GESTURES) 102 #if defined(USE_EVDEV_GESTURES)
105 // Gesture library property provider (used by touchpads/mice). 103 // Gesture library property provider (used by touchpads/mice).
106 scoped_ptr<GesturePropertyProvider> gesture_property_provider_; 104 scoped_ptr<GesturePropertyProvider> gesture_property_provider_;
107 #endif 105 #endif
108 106
109 // Dispatcher for events. 107 // Dispatcher for events.
110 DeviceEventDispatcherEvdev* dispatcher_; 108 scoped_ptr<DeviceEventDispatcherEvdev> dispatcher_;
111 109
112 // Support weak pointers for attach & detach callbacks. 110 // Support weak pointers for attach & detach callbacks.
113 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; 111 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_;
114 112
115 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); 113 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev);
116 }; 114 };
117 115
118 } // namespace ui 116 } // namespace ui
119 117
120 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ 118 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.cc ('k') | ui/events/ozone/evdev/input_device_factory_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698