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

Unified Diff: chrome/browser/extensions/global_shortcut_listener_x11.cc

Issue 219743002: x11: Move X event handling out of the message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r261267 Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/global_shortcut_listener_x11.cc
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chrome/browser/extensions/global_shortcut_listener_x11.cc
index 556bd707a54aa4838c2faa3e0ad9aa61cdb2745c..dd3ed1de80e79a9020051caf0177d4f2fe6b594d 100644
--- a/chrome/browser/extensions/global_shortcut_listener_x11.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.cc
@@ -13,7 +13,7 @@
#if defined(TOOLKIT_GTK)
#include <gdk/gdkx.h>
#else
-#include "base/message_loop/message_pump_x11.h"
+#include "ui/events/platform/x11/x11_event_source.h"
#endif
using content::BrowserThread;
@@ -77,7 +77,7 @@ void GlobalShortcutListenerX11::StartListening() {
&GlobalShortcutListenerX11::OnXEventThunk,
this);
#else
- base::MessagePumpX11::Current()->AddDispatcherForRootWindow(this);
+ ui::X11EventSource::GetInstance()->AddPlatformEventDispatcher(this);
#endif
is_listening_ = true;
@@ -93,18 +93,24 @@ void GlobalShortcutListenerX11::StopListening() {
&GlobalShortcutListenerX11::OnXEventThunk,
this);
#else
- base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow(this);
+ ui::X11EventSource::GetInstance()->RemovePlatformEventDispatcher(this);
#endif
is_listening_ = false;
}
#if !defined(TOOLKIT_GTK)
-uint32_t GlobalShortcutListenerX11::Dispatch(const base::NativeEvent& event) {
- if (event->type == KeyPress)
- OnXKeyPressEvent(event);
+bool GlobalShortcutListenerX11::CanDispatchEvent(
+ const ui::PlatformEvent& event) {
+ return event->type == KeyPress;
+}
+
+uint32_t GlobalShortcutListenerX11::DispatchEvent(
+ const ui::PlatformEvent& event) {
+ CHECK_EQ(KeyPress, event->type);
+ OnXKeyPressEvent(event);
- return POST_DISPATCH_NONE;
+ return ui::POST_DISPATCH_NONE;
}
#endif

Powered by Google App Engine
This is Rietveld 408576698