Chromium Code Reviews| 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" |
| 17 | 18 |
| 18 namespace ui { | 19 namespace ui { |
| 19 | 20 |
| 20 EventConverterEvdev::EventConverterEvdev(int fd, | 21 EventConverterEvdev::EventConverterEvdev(int fd, |
| 21 const base::FilePath& path, | 22 const base::FilePath& path, |
| 22 int id, | 23 int id, |
| 23 InputDeviceType type, | 24 InputDeviceType type, |
| 24 const std::string& name, | 25 const std::string& name, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 Stop(); | 137 Stop(); |
| 137 } else if (written != sizeof(events)) { | 138 } else if (written != sizeof(events)) { |
| 138 LOG(ERROR) << "short write setting leds for " << path_.value(); | 139 LOG(ERROR) << "short write setting leds for " << path_.value(); |
| 139 Stop(); | 140 Stop(); |
| 140 } | 141 } |
| 141 } | 142 } |
| 142 | 143 |
| 143 void EventConverterEvdev::SetTouchEventLoggingEnabled(bool enabled) { | 144 void EventConverterEvdev::SetTouchEventLoggingEnabled(bool enabled) { |
| 144 } | 145 } |
| 145 | 146 |
| 146 base::TimeDelta EventConverterEvdev::TimeDeltaFromInputEvent( | 147 base::TimeTicks EventConverterEvdev::TimeTicksFromInputEvent( |
| 147 const input_event& event) { | 148 const input_event& event) { |
| 148 return base::TimeDelta::FromMicroseconds( | 149 return ui::EventTimeStampFromSeconds(event.time.tv_sec) + |
|
miu
2016/05/16 20:05:35
Same thing here: How will you ensure this does not
majidvp
2016/05/21 01:38:00
Added a validation check. If we find out that it g
majidvp
2016/05/24 21:01:38
After chatting with sadrul@, I decided to add this
miu
2016/05/25 01:42:31
Acknowledged. Looks good.
| |
| 149 static_cast<int64_t>(event.time.tv_sec) * 1000000L + event.time.tv_usec); | 150 base::TimeDelta::FromMicroseconds(event.time.tv_usec); |
| 150 } | 151 } |
| 151 } // namespace ui | 152 } // namespace ui |
| OLD | NEW |