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

Unified Diff: ui/events/platform/x11/x11_event_source.cc

Issue 2879033002: Keyboard Lock Host implementation
Patch Set: Missing change to rename CodeToUsbKeycode to CodeStringToUsbKeycode Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/platform/x11/x11_event_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/platform/x11/x11_event_source.cc
diff --git a/ui/events/platform/x11/x11_event_source.cc b/ui/events/platform/x11/x11_event_source.cc
index f8bbaeb4d0b2e35173f0d5734d52baf1e7b3ef0e..b01c282e24d1f5b170bbb9e0c17eb845f8a7dd54 100644
--- a/ui/events/platform/x11/x11_event_source.cc
+++ b/ui/events/platform/x11/x11_event_source.cc
@@ -237,7 +237,11 @@ void X11EventSource::ExtractCookieDataDispatchEvent(XEvent* xevent) {
dispatching_event_ = xevent;
- delegate_->ProcessXEvent(xevent);
+ if (!filter_ || !filter_->OnPlatformEvent(xevent)) {
+ delegate_->ProcessXEvent(xevent);
+ } else {
+ LOG(ERROR) << "Block XEvent " << xevent;
+ }
PostDispatchEvent(xevent);
dispatching_event_ = nullptr;
@@ -300,4 +304,9 @@ void X11EventSource::OnDispatcherListChanged() {
}
}
+void X11EventSource::set_platform_key_event_filter(
+ keyboard_lock::PlatformKeyEventFilter* filter) {
+ filter_ = filter;
+}
+
} // namespace ui
« no previous file with comments | « ui/events/platform/x11/x11_event_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698