summaryrefslogtreecommitdiffstats
path: root/base/message_pump_x.h
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 00:10:47 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 00:10:47 +0000
commit2e5597c7a7dad2a5255979752de155358c485ad4 (patch)
tree13ba82ec946edc07c058ed35cf2999d402914033 /base/message_pump_x.h
parent8e1eaf972ae4e682b00a75fe4bfc54b2da2199b3 (diff)
downloadchromium_src-2e5597c7a7dad2a5255979752de155358c485ad4.zip
chromium_src-2e5597c7a7dad2a5255979752de155358c485ad4.tar.gz
chromium_src-2e5597c7a7dad2a5255979752de155358c485ad4.tar.bz2
Consolidate message observer API for MessagePumpX and MessagePumWin
This is an attempt to simplify the code around message pump observer. BUG=none TEST=none Review URL: http://codereview.chromium.org/8021009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_x.h')
-rw-r--r--base/message_pump_x.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/base/message_pump_x.h b/base/message_pump_x.h
index eab6f6b..39d7d9c 100644
--- a/base/message_pump_x.h
+++ b/base/message_pump_x.h
@@ -7,6 +7,7 @@
#include "base/message_pump.h"
#include "base/message_pump_glib.h"
+#include "base/message_pump_observer.h"
#include <bitset>
@@ -16,30 +17,11 @@
#include <gtk/gtk.h>
#endif
-typedef union _XEvent XEvent;
typedef struct _XDisplay Display;
namespace base {
// The documentation for this class is in message_pump_glib.h
-class BASE_EXPORT MessagePumpObserver {
- public:
- enum EventStatus {
- EVENT_CONTINUE, // The event should be dispatched as normal.
- EVENT_HANDLED // The event should not be processed any farther.
- };
-
- // This method is called before processing an XEvent. If the method returns
- // EVENT_HANDLED, it indicates the event has already been handled, so the
- // event is not processed any farther. If the method returns EVENT_CONTINUE,
- // the event dispatching proceeds as normal.
- virtual EventStatus WillProcessXEvent(XEvent* xevent);
-
- protected:
- virtual ~MessagePumpObserver() {}
-};
-
-// The documentation for this class is in message_pump_glib.h
//
// The nested loop is exited by either posting a quit, or returning EVENT_QUIT
// from Dispatch.
@@ -97,6 +79,7 @@ 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);
+ void DidProcessXEvent(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