Index: base/message_pump_x.h |
=================================================================== |
--- base/message_pump_x.h (revision 102014) |
+++ base/message_pump_x.h (working copy) |
@@ -11,10 +11,7 @@ |
#include <bitset> |
#include <glib.h> |
- |
-#if defined(TOOLKIT_USES_GTK) |
#include <gtk/gtk.h> |
-#endif |
typedef union _XEvent XEvent; |
typedef struct _XDisplay Display; |
@@ -67,14 +64,16 @@ |
MessagePumpX(); |
virtual ~MessagePumpX(); |
+ // Indicates whether a GDK event was injected by chrome (when |true|) or if it |
+ // was captured and being processed by GDK (when |false|). |
+ bool IsDispatchingEvent(void) { return dispatching_event_; } |
+ |
// Overridden from MessagePumpGlib: |
virtual bool RunOnce(GMainContext* context, bool block) OVERRIDE; |
-#if defined(TOOLKIT_USES_GTK) |
// Disables Gtk/Gdk event pumping. This will be used when |
// NativeWidgetX is enabled. |
static void DisableGtkMessagePump(); |
-#endif |
// Returns default X Display. |
static Display* GetDefaultXDisplay(); |
@@ -83,9 +82,16 @@ |
static bool HasXInput2(); |
private: |
- // Initializes the glib event source for X. |
- void InitXSource(); |
+ // Some XEvent's can't be directly read from X event queue and will go |
+ // through GDK's dispatching process and may get discarded. This function |
+ // sets up a filter to intercept those XEvent's we are interested in |
+ // and dispatches them so that they won't get lost. |
+ static GdkFilterReturn GdkEventFilter(GdkXEvent* gxevent, |
+ GdkEvent* gevent, |
+ gpointer data); |
+ static void EventDispatcherX(GdkEvent* event, gpointer data); |
+ |
// Decides whether we are interested in processing this XEvent. |
bool ShouldCaptureXEvent(XEvent* event); |
@@ -97,25 +103,15 @@ |
// not send the event to any other observers and returns true. Returns false |
// if no observer returns true. |
bool WillProcessXEvent(XEvent* xevent); |
-#if defined(TOOLKIT_USES_GTK) |
- // Some XEvent's can't be directly read from X event queue and will go |
- // through GDK's dispatching process and may get discarded. This function |
- // sets up a filter to intercept those XEvent's we are interested in |
- // and dispatches them so that they won't get lost. |
- static GdkFilterReturn GdkEventFilter(GdkXEvent* gxevent, |
- GdkEvent* gevent, |
- gpointer data); |
- static void EventDispatcherX(GdkEvent* event, gpointer data); |
- |
- // Indicates whether a GDK event was injected by chrome (when |true|) or if it |
- // was captured and being processed by GDK (when |false|). |
- bool IsDispatchingEvent(void) { return dispatching_event_; } |
- |
// Update the lookup table and flag the events that should be captured and |
// processed so that GDK doesn't get to them. |
void InitializeEventsToCapture(void); |
+ // The event source for X events (used only when GTK event processing is |
+ // disabled). |
+ GSource* x_source_; |
+ |
// The event source for GDK events. |
GSource* gdksource_; |
@@ -144,12 +140,7 @@ |
// it should be passed on to the default GDK handler. |
std::bitset<XLASTEvent> capture_x_events_; |
std::bitset<GDK_EVENT_LAST> capture_gdk_events_; |
-#endif // defined(TOOLKIT_USES_GTK) |
- // The event source for X events (used only when GTK event processing is |
- // disabled). |
- GSource* x_source_; |
- |
DISALLOW_COPY_AND_ASSIGN(MessagePumpX); |
}; |