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 #include <utility> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 void EventReaderLibevdevCros::OnDisabled() { | 104 void EventReaderLibevdevCros::OnDisabled() { |
105 delegate_->OnLibEvdevCrosStopped(&evdev_, &evstate_); | 105 delegate_->OnLibEvdevCrosStopped(&evdev_, &evstate_); |
106 } | 106 } |
107 | 107 |
108 // static | 108 // static |
109 void EventReaderLibevdevCros::OnSynReport(void* data, | 109 void EventReaderLibevdevCros::OnSynReport(void* data, |
110 EventStateRec* evstate, | 110 EventStateRec* evstate, |
111 struct timeval* tv) { | 111 struct timeval* tv) { |
112 EventReaderLibevdevCros* reader = static_cast<EventReaderLibevdevCros*>(data); | 112 EventReaderLibevdevCros* reader = static_cast<EventReaderLibevdevCros*>(data); |
113 if (!reader->enabled_) | 113 if (!reader->IsEnabled()) |
114 return; | 114 return; |
115 | 115 |
116 reader->delegate_->OnLibEvdevCrosEvent(&reader->evdev_, evstate, *tv); | 116 reader->delegate_->OnLibEvdevCrosEvent(&reader->evdev_, evstate, *tv); |
117 } | 117 } |
118 | 118 |
119 // static | 119 // static |
120 void EventReaderLibevdevCros::OnLogMessage(void* data, | 120 void EventReaderLibevdevCros::OnLogMessage(void* data, |
121 int level, | 121 int level, |
122 const char* fmt, | 122 const char* fmt, |
123 ...) { | 123 ...) { |
124 va_list args; | 124 va_list args; |
125 va_start(args, fmt); | 125 va_start(args, fmt); |
126 if (level >= LOGLEVEL_ERROR) | 126 if (level >= LOGLEVEL_ERROR) |
127 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args); | 127 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args); |
128 else if (level >= LOGLEVEL_WARNING) | 128 else if (level >= LOGLEVEL_WARNING) |
129 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args); | 129 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args); |
130 else | 130 else |
131 VLOG(3) << "libevdev: " << FormatLog(fmt, args); | 131 VLOG(3) << "libevdev: " << FormatLog(fmt, args); |
132 va_end(args); | 132 va_end(args); |
133 } | 133 } |
134 | 134 |
135 } // namespace ui | 135 } // namespace ui |
OLD | NEW |