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 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 OpenInputDeviceReplyCallback reply_callback = | 223 OpenInputDeviceReplyCallback reply_callback = |
224 base::Bind(&InputDeviceFactoryEvdev::AttachInputDevice, | 224 base::Bind(&InputDeviceFactoryEvdev::AttachInputDevice, |
225 weak_ptr_factory_.GetWeakPtr()); | 225 weak_ptr_factory_.GetWeakPtr()); |
226 | 226 |
227 ++pending_device_changes_; | 227 ++pending_device_changes_; |
228 | 228 |
229 // Dispatch task to open from the worker pool, since open may block. | 229 // Dispatch task to open from the worker pool, since open may block. |
230 base::WorkerPool::PostTask(FROM_HERE, | 230 base::WorkerPool::PostTask(FROM_HERE, |
231 base::Bind(&OpenInputDevice, base::Passed(¶ms), | 231 base::Bind(&OpenInputDevice, base::Passed(¶ms), |
232 task_runner_, reply_callback), | 232 task_runner_, reply_callback), |
233 true /* task_is_slow */); | 233 false /* task_is_slow */); |
234 } | 234 } |
235 | 235 |
236 void InputDeviceFactoryEvdev::RemoveInputDevice(const base::FilePath& path) { | 236 void InputDeviceFactoryEvdev::RemoveInputDevice(const base::FilePath& path) { |
237 DetachInputDevice(path); | 237 DetachInputDevice(path); |
238 } | 238 } |
239 | 239 |
240 void InputDeviceFactoryEvdev::AttachInputDevice( | 240 void InputDeviceFactoryEvdev::AttachInputDevice( |
241 scoped_ptr<EventConverterEvdev> converter) { | 241 scoped_ptr<EventConverterEvdev> converter) { |
242 if (converter.get()) { | 242 if (converter.get()) { |
243 const base::FilePath& path = converter->path(); | 243 const base::FilePath& path = converter->path(); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 std::vector<int> ids; | 498 std::vector<int> ids; |
499 gesture_property_provider_->GetDeviceIdsByType(type, &ids); | 499 gesture_property_provider_->GetDeviceIdsByType(type, &ids); |
500 for (size_t i = 0; i < ids.size(); ++i) { | 500 for (size_t i = 0; i < ids.size(); ++i) { |
501 SetGestureBoolProperty(gesture_property_provider_.get(), ids[i], name, | 501 SetGestureBoolProperty(gesture_property_provider_.get(), ids[i], name, |
502 value); | 502 value); |
503 } | 503 } |
504 #endif | 504 #endif |
505 } | 505 } |
506 | 506 |
507 } // namespace ui | 507 } // namespace ui |
OLD | NEW |