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

Unified Diff: base/message_pump_x.h

Issue 7904034: aura: Explicitly disable GTK (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 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 | « base/message_pump_glib_unittest.cc ('k') | base/message_pump_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_x.h
diff --git a/base/message_pump_x.h b/base/message_pump_x.h
index c13f323a64676396152404220838e2be03142862..eab6f6bad1195c90014c2b59c08cbff930c2013a 100644
--- a/base/message_pump_x.h
+++ b/base/message_pump_x.h
@@ -11,7 +11,10 @@
#include <bitset>
#include <glib.h>
+
+#if defined(TOOLKIT_USES_GTK)
#include <gtk/gtk.h>
+#endif
typedef union _XEvent XEvent;
typedef struct _XDisplay Display;
@@ -64,16 +67,14 @@ class BASE_EXPORT MessagePumpX : public MessagePumpGlib {
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();
@@ -82,15 +83,8 @@ class BASE_EXPORT MessagePumpX : public MessagePumpGlib {
static bool HasXInput2();
private:
- // 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);
+ // Initializes the glib event source for X.
+ void InitXSource();
// Decides whether we are interested in processing this XEvent.
bool ShouldCaptureXEvent(XEvent* event);
@@ -103,15 +97,25 @@ class BASE_EXPORT MessagePumpX : public MessagePumpGlib {
// 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_;
@@ -140,6 +144,11 @@ class BASE_EXPORT MessagePumpX : public MessagePumpGlib {
// 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);
};
« no previous file with comments | « base/message_pump_glib_unittest.cc ('k') | base/message_pump_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698