Index: base/message_pump_win.h |
diff --git a/base/message_pump_win.h b/base/message_pump_win.h |
index fd461988ed9527569ff66849983306c8c868e790..f69ce9d983626fb85059767f6582e24095e27961 100644 |
--- a/base/message_pump_win.h |
+++ b/base/message_pump_win.h |
@@ -11,6 +11,7 @@ |
#include "base/base_export.h" |
#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/message_pump.h" |
#include "base/message_pump_dispatcher.h" |
#include "base/message_pump_observer.h" |
@@ -126,6 +127,24 @@ class BASE_EXPORT MessagePumpWin : public MessagePump { |
// |
class BASE_EXPORT MessagePumpForUI : public MessagePumpWin { |
public: |
+ // A MessageFilter implements the common Peek/Translate/Dispatch code to deal |
+ // with windows messages. |
+ class MessageFilter { |
+ public: |
+ virtual ~MessageFilter() {} |
+ virtual bool Init() = 0; |
+ // Implements the functionality exposed by the OS through PeekMessage. |
+ virtual BOOL DoPeekMessage(MSG* messge, |
cpu_(ooo_6.6-7.5)
2012/08/22 21:37:18
should this be a bool instead of a BOOL ?
rvargas (doing something else)
2012/08/23 01:20:19
This follows the signature of the function that is
yoichio
2012/08/23 02:44:59
This is thin wrapper for PeekMessage so signature
|
+ HWND hwnd, |
+ UINT msg_filter_min, |
+ UINT msg_filter_max, |
+ UINT remove_msg) = 0; |
+ // Implements some special procedure for got message. |
+ // If returns true, |message| should not be dispatched by neither |
+ // DispatchMessage nor MessagePumpDispatcher. |
+ virtual bool ProcessMessage(const MSG& message) = 0; |
+ }; |
+ |
// The application-defined code passed to the hook procedure. |
static const int kMessageFilterCode = 0x5001; |
@@ -142,8 +161,10 @@ class BASE_EXPORT MessagePumpForUI : public MessagePumpWin { |
void PumpOutPendingPaintMessages(); |
private: |
- static LRESULT CALLBACK WndProcThunk( |
- HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); |
+ static LRESULT CALLBACK WndProcThunk(HWND hwnd, |
+ UINT message, |
+ WPARAM wparam, |
+ LPARAM lparam); |
virtual void DoRunLoop(); |
void InitMessageWnd(); |
void WaitForWork(); |
@@ -158,6 +179,8 @@ class BASE_EXPORT MessagePumpForUI : public MessagePumpWin { |
// A hidden message-only window. |
HWND message_hwnd_; |
+ |
+ scoped_ptr<MessageFilter> message_filter_; |
}; |
//----------------------------------------------------------------------------- |