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

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

Issue 2879033002: Keyboard Lock Host implementation
Patch Set: Remove useless files Created 3 years, 4 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 b27acd877ee1e734fbbe937a6b9abddf168fda24..dd13e8b769694691790a6f16b2f0e6fd5fec374d 100644
--- a/ui/events/platform/x11/x11_event_source.cc
+++ b/ui/events/platform/x11/x11_event_source.cc
@@ -238,7 +238,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;
@@ -301,4 +305,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