Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc

Issue 990483002: ozone: evdev: Fix possibility of stuck keys with libevdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 scoped_ptr<std::set<DomCode>> allowed_keys) { 91 scoped_ptr<std::set<DomCode>> allowed_keys) {
92 DCHECK(HasKeyboard()); 92 DCHECK(HasKeyboard());
93 delegate_->SetAllowedKeys(allowed_keys.Pass()); 93 delegate_->SetAllowedKeys(allowed_keys.Pass());
94 } 94 }
95 95
96 void EventReaderLibevdevCros::AllowAllKeys() { 96 void EventReaderLibevdevCros::AllowAllKeys() {
97 DCHECK(HasKeyboard()); 97 DCHECK(HasKeyboard());
98 delegate_->AllowAllKeys(); 98 delegate_->AllowAllKeys();
99 } 99 }
100 100
101 void EventReaderLibevdevCros::OnStopped() {
102 delegate_->OnLibEvdevCrosStopped(&evdev_, &evstate_);
103 }
104
101 // static 105 // static
102 void EventReaderLibevdevCros::OnSynReport(void* data, 106 void EventReaderLibevdevCros::OnSynReport(void* data,
103 EventStateRec* evstate, 107 EventStateRec* evstate,
104 struct timeval* tv) { 108 struct timeval* tv) {
105 EventReaderLibevdevCros* reader = static_cast<EventReaderLibevdevCros*>(data); 109 EventReaderLibevdevCros* reader = static_cast<EventReaderLibevdevCros*>(data);
106 if (reader->ignore_events_) 110 if (reader->ignore_events_)
107 return; 111 return;
108 112
109 reader->delegate_->OnLibEvdevCrosEvent(&reader->evdev_, evstate, *tv); 113 reader->delegate_->OnLibEvdevCrosEvent(&reader->evdev_, evstate, *tv);
110 } 114 }
111 115
112 // static 116 // static
113 void EventReaderLibevdevCros::OnLogMessage(void* data, 117 void EventReaderLibevdevCros::OnLogMessage(void* data,
114 int level, 118 int level,
115 const char* fmt, 119 const char* fmt,
116 ...) { 120 ...) {
117 va_list args; 121 va_list args;
118 va_start(args, fmt); 122 va_start(args, fmt);
119 if (level >= LOGLEVEL_ERROR) 123 if (level >= LOGLEVEL_ERROR)
120 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args); 124 LOG(ERROR) << "libevdev: " << FormatLog(fmt, args);
121 else if (level >= LOGLEVEL_WARNING) 125 else if (level >= LOGLEVEL_WARNING)
122 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args); 126 LOG(WARNING) << "libevdev: " << FormatLog(fmt, args);
123 else 127 else
124 VLOG(3) << "libevdev: " << FormatLog(fmt, args); 128 VLOG(3) << "libevdev: " << FormatLog(fmt, args);
125 va_end(args); 129 va_end(args);
126 } 130 }
127 131
128 } // namespace ui 132 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698