| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // run it on the FILE thread. | 155 // run it on the FILE thread. |
| 156 void CloseInputDevice(const base::FilePath& path, | 156 void CloseInputDevice(const base::FilePath& path, |
| 157 scoped_ptr<EventConverterEvdev> converter) { | 157 scoped_ptr<EventConverterEvdev> converter) { |
| 158 TRACE_EVENT1("ozone", "CloseInputDevice", "path", path.value()); | 158 TRACE_EVENT1("ozone", "CloseInputDevice", "path", path.value()); |
| 159 converter.reset(); | 159 converter.reset(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace | 162 } // namespace |
| 163 | 163 |
| 164 EventFactoryEvdev::EventFactoryEvdev(CursorDelegateEvdev* cursor, | 164 EventFactoryEvdev::EventFactoryEvdev(CursorDelegateEvdev* cursor, |
| 165 DeviceManager* device_manager) | 165 DeviceManager* device_manager, |
| 166 KeyboardLayoutEngine* keyboard_layout) |
| 166 : last_device_id_(0), | 167 : last_device_id_(0), |
| 167 device_manager_(device_manager), | 168 device_manager_(device_manager), |
| 168 dispatch_callback_( | 169 dispatch_callback_( |
| 169 base::Bind(&EventFactoryEvdev::PostUiEvent, base::Unretained(this))), | 170 base::Bind(&EventFactoryEvdev::PostUiEvent, base::Unretained(this))), |
| 170 keyboard_(&modifiers_, dispatch_callback_), | 171 keyboard_(&modifiers_, keyboard_layout, dispatch_callback_), |
| 171 cursor_(cursor), | 172 cursor_(cursor), |
| 172 #if defined(USE_EVDEV_GESTURES) | 173 #if defined(USE_EVDEV_GESTURES) |
| 173 gesture_property_provider_(new GesturePropertyProvider), | 174 gesture_property_provider_(new GesturePropertyProvider), |
| 174 #endif | 175 #endif |
| 175 input_controller_(this, | 176 input_controller_(this, |
| 176 &button_map_ | 177 &button_map_ |
| 177 #if defined(USE_EVDEV_GESTURES) | 178 #if defined(USE_EVDEV_GESTURES) |
| 178 , | 179 , |
| 179 gesture_property_provider_.get() | 180 gesture_property_provider_.get() |
| 180 #endif | 181 #endif |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 gesture_property_provider_->GetDeviceIdsByType(type, &ids); | 349 gesture_property_provider_->GetDeviceIdsByType(type, &ids); |
| 349 #endif | 350 #endif |
| 350 // In the future we can add other device matching logics here. | 351 // In the future we can add other device matching logics here. |
| 351 | 352 |
| 352 if (device_ids) | 353 if (device_ids) |
| 353 device_ids->assign(ids.begin(), ids.end()); | 354 device_ids->assign(ids.begin(), ids.end()); |
| 354 return !ids.empty(); | 355 return !ids.empty(); |
| 355 } | 356 } |
| 356 | 357 |
| 357 } // namespace ui | 358 } // namespace ui |
| OLD | NEW |