Chromium Code Reviews| 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 |