| 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_converter_evdev_impl.h" | 5 #include "ui/events/ozone/evdev/event_converter_evdev_impl.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 devinfo.product_id()), | 46 devinfo.product_id()), |
| 47 input_device_fd_(std::move(fd)), | 47 input_device_fd_(std::move(fd)), |
| 48 has_keyboard_(devinfo.HasKeyboard()), | 48 has_keyboard_(devinfo.HasKeyboard()), |
| 49 has_touchpad_(devinfo.HasTouchpad()), | 49 has_touchpad_(devinfo.HasTouchpad()), |
| 50 has_caps_lock_led_(devinfo.HasLedEvent(LED_CAPSL)), | 50 has_caps_lock_led_(devinfo.HasLedEvent(LED_CAPSL)), |
| 51 controller_(FROM_HERE), | 51 controller_(FROM_HERE), |
| 52 cursor_(cursor), | 52 cursor_(cursor), |
| 53 dispatcher_(dispatcher) {} | 53 dispatcher_(dispatcher) {} |
| 54 | 54 |
| 55 EventConverterEvdevImpl::~EventConverterEvdevImpl() { | 55 EventConverterEvdevImpl::~EventConverterEvdevImpl() { |
| 56 DCHECK(!enabled_); | |
| 57 } | 56 } |
| 58 | 57 |
| 59 void EventConverterEvdevImpl::OnFileCanReadWithoutBlocking(int fd) { | 58 void EventConverterEvdevImpl::OnFileCanReadWithoutBlocking(int fd) { |
| 60 TRACE_EVENT1("evdev", "EventConverterEvdevImpl::OnFileCanReadWithoutBlocking", | 59 TRACE_EVENT1("evdev", "EventConverterEvdevImpl::OnFileCanReadWithoutBlocking", |
| 61 "fd", fd); | 60 "fd", fd); |
| 62 | 61 |
| 63 input_event inputs[4]; | 62 input_event inputs[4]; |
| 64 ssize_t read_size = read(fd, inputs, sizeof(inputs)); | 63 ssize_t read_size = read(fd, inputs, sizeof(inputs)); |
| 65 if (read_size < 0) { | 64 if (read_size < 0) { |
| 66 if (errno == EINTR || errno == EAGAIN) | 65 if (errno == EINTR || errno == EAGAIN) |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 dispatcher_->DispatchMouseMoveEvent( | 251 dispatcher_->DispatchMouseMoveEvent( |
| 253 MouseMoveEventParams(input_device_.id, EF_NONE, cursor_->GetLocation(), | 252 MouseMoveEventParams(input_device_.id, EF_NONE, cursor_->GetLocation(), |
| 254 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), | 253 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), |
| 255 TimeTicksFromInputEvent(input))); | 254 TimeTicksFromInputEvent(input))); |
| 256 | 255 |
| 257 x_offset_ = 0; | 256 x_offset_ = 0; |
| 258 y_offset_ = 0; | 257 y_offset_ = 0; |
| 259 } | 258 } |
| 260 | 259 |
| 261 } // namespace ui | 260 } // namespace ui |
| OLD | NEW |