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 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 5 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <linux/input.h> | 8 #include <linux/input.h> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // run it on the FILE thread. | 161 // run it on the FILE thread. |
162 void CloseInputDevice(const base::FilePath& path, | 162 void CloseInputDevice(const base::FilePath& path, |
163 scoped_ptr<EventConverterEvdev> converter) { | 163 scoped_ptr<EventConverterEvdev> converter) { |
164 TRACE_EVENT1("ozone", "CloseInputDevice", "path", path.value()); | 164 TRACE_EVENT1("ozone", "CloseInputDevice", "path", path.value()); |
165 converter.reset(); | 165 converter.reset(); |
166 } | 166 } |
167 | 167 |
168 } // namespace | 168 } // namespace |
169 | 169 |
170 EventFactoryEvdev::EventFactoryEvdev(CursorDelegateEvdev* cursor, | 170 EventFactoryEvdev::EventFactoryEvdev(CursorDelegateEvdev* cursor, |
171 DeviceManager* device_manager) | 171 DeviceManager* device_manager, |
| 172 KeyboardLayoutEngine* keyboard_layout) |
172 : last_device_id_(0), | 173 : last_device_id_(0), |
173 device_manager_(device_manager), | 174 device_manager_(device_manager), |
174 dispatch_callback_( | 175 dispatch_callback_( |
175 base::Bind(&EventFactoryEvdev::PostUiEvent, base::Unretained(this))), | 176 base::Bind(&EventFactoryEvdev::PostUiEvent, base::Unretained(this))), |
176 keyboard_(&modifiers_, dispatch_callback_), | 177 keyboard_(&modifiers_, keyboard_layout, dispatch_callback_), |
177 cursor_(cursor), | 178 cursor_(cursor), |
178 #if defined(USE_EVDEV_GESTURES) | 179 #if defined(USE_EVDEV_GESTURES) |
179 gesture_property_provider_(new GesturePropertyProvider), | 180 gesture_property_provider_(new GesturePropertyProvider), |
180 #endif | 181 #endif |
181 input_controller_(this, | 182 input_controller_(this, |
182 &button_map_ | 183 &button_map_ |
183 #if defined(USE_EVDEV_GESTURES) | 184 #if defined(USE_EVDEV_GESTURES) |
184 , | 185 , |
185 gesture_property_provider_.get() | 186 gesture_property_provider_.get() |
186 #endif | 187 #endif |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 gesture_property_provider_->GetDeviceIdsByType(type, &ids); | 365 gesture_property_provider_->GetDeviceIdsByType(type, &ids); |
365 #endif | 366 #endif |
366 // In the future we can add other device matching logics here. | 367 // In the future we can add other device matching logics here. |
367 | 368 |
368 if (device_ids) | 369 if (device_ids) |
369 device_ids->assign(ids.begin(), ids.end()); | 370 device_ids->assign(ids.begin(), ids.end()); |
370 return !ids.empty(); | 371 return !ids.empty(); |
371 } | 372 } |
372 | 373 |
373 } // namespace ui | 374 } // namespace ui |
OLD | NEW |