| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/input_device_factory_evdev.h" | 5 #include "ui/events/ozone/evdev/input_device_factory_evdev.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 const EventDeviceInfo& devinfo) { | 88 const EventDeviceInfo& devinfo) { |
| 89 #if defined(USE_EVDEV_GESTURES) | 89 #if defined(USE_EVDEV_GESTURES) |
| 90 // Touchpad or mouse: use gestures library. | 90 // Touchpad or mouse: use gestures library. |
| 91 // EventReaderLibevdevCros -> GestureInterpreterLibevdevCros -> DispatchEvent | 91 // EventReaderLibevdevCros -> GestureInterpreterLibevdevCros -> DispatchEvent |
| 92 if (devinfo.HasTouchpad() || devinfo.HasMouse()) { | 92 if (devinfo.HasTouchpad() || devinfo.HasMouse()) { |
| 93 scoped_ptr<GestureInterpreterLibevdevCros> gesture_interp = | 93 scoped_ptr<GestureInterpreterLibevdevCros> gesture_interp = |
| 94 make_scoped_ptr(new GestureInterpreterLibevdevCros( | 94 make_scoped_ptr(new GestureInterpreterLibevdevCros( |
| 95 params.id, params.cursor, params.gesture_property_provider, | 95 params.id, params.cursor, params.gesture_property_provider, |
| 96 params.dispatcher)); | 96 params.dispatcher)); |
| 97 return make_scoped_ptr(new EventReaderLibevdevCros( | 97 return make_scoped_ptr(new EventReaderLibevdevCros( |
| 98 fd, params.path, params.id, devinfo, gesture_interp.Pass())); | 98 fd, params.path, params.id, devinfo, std::move(gesture_interp))); |
| 99 } | 99 } |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 // Touchscreen: use TouchEventConverterEvdev. | 102 // Touchscreen: use TouchEventConverterEvdev. |
| 103 if (devinfo.HasTouchscreen()) { | 103 if (devinfo.HasTouchscreen()) { |
| 104 scoped_ptr<TouchEventConverterEvdev> converter(new TouchEventConverterEvdev( | 104 scoped_ptr<TouchEventConverterEvdev> converter(new TouchEventConverterEvdev( |
| 105 fd, params.path, params.id, devinfo, params.dispatcher)); | 105 fd, params.path, params.id, devinfo, params.dispatcher)); |
| 106 converter->Initialize(devinfo); | 106 converter->Initialize(devinfo); |
| 107 return std::move(converter); | 107 return std::move(converter); |
| 108 } | 108 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 reply.Run(std::move(status)); | 296 reply.Run(std::move(status)); |
| 297 } | 297 } |
| 298 | 298 |
| 299 void InputDeviceFactoryEvdev::GetTouchEventLog( | 299 void InputDeviceFactoryEvdev::GetTouchEventLog( |
| 300 const base::FilePath& out_dir, | 300 const base::FilePath& out_dir, |
| 301 const GetTouchEventLogReply& reply) { | 301 const GetTouchEventLogReply& reply) { |
| 302 scoped_ptr<std::vector<base::FilePath>> log_paths( | 302 scoped_ptr<std::vector<base::FilePath>> log_paths( |
| 303 new std::vector<base::FilePath>); | 303 new std::vector<base::FilePath>); |
| 304 #if defined(USE_EVDEV_GESTURES) | 304 #if defined(USE_EVDEV_GESTURES) |
| 305 DumpTouchEventLog(converters_, gesture_property_provider_.get(), out_dir, | 305 DumpTouchEventLog(converters_, gesture_property_provider_.get(), out_dir, |
| 306 log_paths.Pass(), reply); | 306 std::move(log_paths), reply); |
| 307 #else | 307 #else |
| 308 reply.Run(std::move(log_paths)); | 308 reply.Run(std::move(log_paths)); |
| 309 #endif | 309 #endif |
| 310 } | 310 } |
| 311 | 311 |
| 312 base::WeakPtr<InputDeviceFactoryEvdev> InputDeviceFactoryEvdev::GetWeakPtr() { | 312 base::WeakPtr<InputDeviceFactoryEvdev> InputDeviceFactoryEvdev::GetWeakPtr() { |
| 313 return weak_ptr_factory_.GetWeakPtr(); | 313 return weak_ptr_factory_.GetWeakPtr(); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void InputDeviceFactoryEvdev::ApplyInputDeviceSettings() { | 316 void InputDeviceFactoryEvdev::ApplyInputDeviceSettings() { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 std::vector<int> ids; | 482 std::vector<int> ids; |
| 483 gesture_property_provider_->GetDeviceIdsByType(type, &ids); | 483 gesture_property_provider_->GetDeviceIdsByType(type, &ids); |
| 484 for (size_t i = 0; i < ids.size(); ++i) { | 484 for (size_t i = 0; i < ids.size(); ++i) { |
| 485 SetGestureBoolProperty(gesture_property_provider_.get(), ids[i], name, | 485 SetGestureBoolProperty(gesture_property_provider_.get(), ids[i], name, |
| 486 value); | 486 value); |
| 487 } | 487 } |
| 488 #endif | 488 #endif |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace ui | 491 } // namespace ui |
| OLD | NEW |