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/libgestures_glue/event_reader_libevdev_cros.h" | 5 #include "ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <libevdev/libevdev.h> | 8 #include <libevdev/libevdev.h> |
9 #include <linux/input.h> | 9 #include <linux/input.h> |
| 10 #include <utility> |
10 | 11 |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
14 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
15 | 16 |
16 namespace ui { | 17 namespace ui { |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
(...skipping 15 matching lines...) Expand all Loading... |
35 path, | 36 path, |
36 id, | 37 id, |
37 devinfo.device_type(), | 38 devinfo.device_type(), |
38 devinfo.name(), | 39 devinfo.name(), |
39 devinfo.vendor_id(), | 40 devinfo.vendor_id(), |
40 devinfo.product_id()), | 41 devinfo.product_id()), |
41 has_keyboard_(devinfo.HasKeyboard()), | 42 has_keyboard_(devinfo.HasKeyboard()), |
42 has_mouse_(devinfo.HasMouse()), | 43 has_mouse_(devinfo.HasMouse()), |
43 has_touchpad_(devinfo.HasTouchpad()), | 44 has_touchpad_(devinfo.HasTouchpad()), |
44 has_caps_lock_led_(devinfo.HasLedEvent(LED_CAPSL)), | 45 has_caps_lock_led_(devinfo.HasLedEvent(LED_CAPSL)), |
45 delegate_(delegate.Pass()) { | 46 delegate_(std::move(delegate)) { |
46 // This class assumes it does not deal with internal keyboards. | 47 // This class assumes it does not deal with internal keyboards. |
47 CHECK(!has_keyboard_ || type() != INPUT_DEVICE_INTERNAL); | 48 CHECK(!has_keyboard_ || type() != INPUT_DEVICE_INTERNAL); |
48 | 49 |
49 memset(&evdev_, 0, sizeof(evdev_)); | 50 memset(&evdev_, 0, sizeof(evdev_)); |
50 evdev_.log = OnLogMessage; | 51 evdev_.log = OnLogMessage; |
51 evdev_.log_udata = this; | 52 evdev_.log_udata = this; |
52 evdev_.syn_report = OnSynReport; | 53 evdev_.syn_report = OnSynReport; |
53 evdev_.syn_report_udata = this; | 54 evdev_.syn_report_udata = this; |
54 evdev_.fd = fd; | 55 evdev_.fd = fd; |
55 | 56 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 if (level >= LOGLEVEL_ERROR) | 126 if (level >= LOGLEVEL_ERROR) |
126 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args); | 127 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args); |
127 else if (level >= LOGLEVEL_WARNING) | 128 else if (level >= LOGLEVEL_WARNING) |
128 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args); | 129 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args); |
129 else | 130 else |
130 VLOG(3) << "libevdev: " << FormatLog(fmt, args); | 131 VLOG(3) << "libevdev: " << FormatLog(fmt, args); |
131 va_end(args); | 132 va_end(args); |
132 } | 133 } |
133 | 134 |
134 } // namespace ui | 135 } // namespace ui |
OLD | NEW |