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

Unified Diff: base/message_pump_x.h

Issue 8021009: Consolidate message observer API for win and aura (and touch). (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_win.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 eab6f6bad1195c90014c2b59c08cbff930c2013a..621074676af3efac1dfc2c2dea55eccf73f48426 100644
--- a/base/message_pump_x.h
+++ b/base/message_pump_x.h
@@ -21,19 +21,24 @@ typedef struct _XDisplay Display;
namespace base {
+typedef XEvent* NativeEvent;
+
+enum EventStatus {
+ EVENT_CONTINUE, // The event should be dispatched as normal.
+ EVENT_HANDLED // The event should not be processed any farther.
+};
+
// The documentation for this class is in message_pump_glib.h
class BASE_EXPORT MessagePumpObserver {
darin (slow to review) 2011/09/23 20:58:46 it seems like you should factor this out into a se
oshima 2011/09/23 21:12:59 Yes, will do. So are you ok to have NativeEvent in
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);
+ virtual EventStatus WillProcessEvent(const NativeEvent& xevent) = 0;
+
+ // This method is called after processing a message.
+ virtual void DidProcessEvent(const NativeEvent& event) = 0;
protected:
virtual ~MessagePumpObserver() {}
@@ -97,6 +102,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
« no previous file with comments | « base/message_pump_win.cc ('k') | base/message_pump_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698