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 <errno.h> | 5 #include <errno.h> |
6 #include <linux/input.h> | 6 #include <linux/input.h> |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ui/events/ozone/evdev/event_converter_evdev.h" | 9 #include "ui/events/ozone/evdev/event_converter_evdev.h" |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 #include "ui/events/base_event_utils.h" |
15 #include "ui/events/devices/device_util_linux.h" | 16 #include "ui/events/devices/device_util_linux.h" |
16 #include "ui/events/devices/input_device.h" | 17 #include "ui/events/devices/input_device.h" |
| 18 #include "ui/events/event_utils.h" |
17 | 19 |
18 namespace ui { | 20 namespace ui { |
19 | 21 |
20 EventConverterEvdev::EventConverterEvdev(int fd, | 22 EventConverterEvdev::EventConverterEvdev(int fd, |
21 const base::FilePath& path, | 23 const base::FilePath& path, |
22 int id, | 24 int id, |
23 InputDeviceType type, | 25 InputDeviceType type, |
24 const std::string& name, | 26 const std::string& name, |
25 uint16_t vendor_id, | 27 uint16_t vendor_id, |
26 uint16_t product_id) | 28 uint16_t product_id) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 Stop(); | 138 Stop(); |
137 } else if (written != sizeof(events)) { | 139 } else if (written != sizeof(events)) { |
138 LOG(ERROR) << "short write setting leds for " << path_.value(); | 140 LOG(ERROR) << "short write setting leds for " << path_.value(); |
139 Stop(); | 141 Stop(); |
140 } | 142 } |
141 } | 143 } |
142 | 144 |
143 void EventConverterEvdev::SetTouchEventLoggingEnabled(bool enabled) { | 145 void EventConverterEvdev::SetTouchEventLoggingEnabled(bool enabled) { |
144 } | 146 } |
145 | 147 |
146 base::TimeDelta EventConverterEvdev::TimeDeltaFromInputEvent( | 148 base::TimeTicks EventConverterEvdev::TimeTicksFromInputEvent( |
147 const input_event& event) { | 149 const input_event& event) { |
148 return base::TimeDelta::FromMicroseconds( | 150 return ui::EventTimeStampFromSeconds(event.time.tv_sec) + |
149 static_cast<int64_t>(event.time.tv_sec) * 1000000L + event.time.tv_usec); | 151 base::TimeDelta::FromMicroseconds(event.time.tv_usec); |
150 } | 152 } |
151 } // namespace ui | 153 } // namespace ui |
OLD | NEW |