summaryrefslogtreecommitdiffstats
path: root/ui/base/win
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-24 01:58:19 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-24 01:58:19 +0000
commit76c1a2b3581e9df09e3b524470ca9faf1195796b (patch)
treea43e24dc62f6e40d9be5f3f6c04323449c75be3f /ui/base/win
parent6ed674310c29b76c0754aad5e8f4e7c0019503d3 (diff)
downloadchromium_src-76c1a2b3581e9df09e3b524470ca9faf1195796b.zip
chromium_src-76c1a2b3581e9df09e3b524470ca9faf1195796b.tar.gz
chromium_src-76c1a2b3581e9df09e3b524470ca9faf1195796b.tar.bz2
Updated the WindowEventTarget interface in ui\base to return a bool from all its methods which indicates whether the message was handled.
This is to ensure that the default handling on the Windows message is performed by the caller (LegacyRenderWidgetHostHWND). Most of the changes in this patch are around passing a bool flag to the methods in the WindowEventTarget interface and passing that information from the LegacyRenderWidgetHostHWND to the message crackers in ATL. The changes apart from those are as below:- 1. Added a handler for WM_SYSCOMMAND in the LegacyRenderWidgetHostHWND class. This forwards the message to the parent. This is needed because there are cases when the LegacyRenderWidgetHostHWND class is of the same size as the parent. For e.g. App windows etc. In these cases the LegacyRenderWidgetHostHWND window receives non client mouse messages which when defproced result in the WM_SYSCOMMAND message coming in. 2. There are cases when the LegacyRenderWidgetHostHWND is created after the parent is made visible and the associated RenderWidget is visible. Added code to make the LegacyRenderWidgetHostHWND hwnd visible. 3. Added a Destroy method to the LegacyRenderWidgetHostHWND class. This method destroys the window. The instance is destroyed in OnFinalMessage. This ensures that we don't have issues with the LegacyRenderWidgetHostHWND instance getting deleted in the context of a message and crashes due to us calling SetMsgHandled which dereferences members in the ATL base class. BUG=381609 R=sky Review URL: https://codereview.chromium.org/349563002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/win')
-rw-r--r--ui/base/win/window_event_target.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/ui/base/win/window_event_target.h b/ui/base/win/window_event_target.h
index c7bb670..2c74522 100644
--- a/ui/base/win/window_event_target.h
+++ b/ui/base/win/window_event_target.h
@@ -23,42 +23,68 @@ class UI_BASE_EXPORT WindowEventTarget {
// The |message| parameter identifies the message.
// The |w_param| and |l_param| values are dependent on the type of the
// message.
+ // The |handled| parameter is an output parameter which when set to false
+ // indicates that the message should be DefProc'ed.
// Returns the result of processing the message.
virtual LRESULT HandleMouseMessage(unsigned int message,
WPARAM w_param,
- LPARAM l_param) = 0;
+ LPARAM l_param,
+ bool* handled) = 0;
// Handles keyboard events like WM_KEYDOWN/WM_KEYUP, etc.
// The |message| parameter identifies the message.
// The |w_param| and |l_param| values are dependent on the type of the
// message.
+ // The |handled| parameter is an output parameter which when set to false
+ // indicates that the message should be DefProc'ed.
// Returns the result of processing the message.
virtual LRESULT HandleKeyboardMessage(unsigned int message,
WPARAM w_param,
- LPARAM l_param) = 0;
+ LPARAM l_param,
+ bool* handled) = 0;
// Handles WM_TOUCH events.
// The |message| parameter identifies the message.
// The |w_param| and |l_param| values are as per MSDN docs.
+ // The |handled| parameter is an output parameter which when set to false
+ // indicates that the message should be DefProc'ed.
// Returns the result of processing the message.
virtual LRESULT HandleTouchMessage(unsigned int message,
WPARAM w_param,
- LPARAM l_param) = 0;
+ LPARAM l_param,
+ bool* handled) = 0;
// Handles scroll messages like WM_VSCROLL and WM_HSCROLL.
// The |message| parameter identifies the scroll message.
// The |w_param| and |l_param| values are dependent on the type of scroll.
+ // The |handled| parameter is an output parameter which when set to false
+ // indicates that the message should be DefProc'ed.
virtual LRESULT HandleScrollMessage(unsigned int message,
WPARAM w_param,
- LPARAM l_param) = 0;
+ LPARAM l_param,
+ bool* handled) = 0;
// Handles the WM_NCHITTEST message
// The |message| parameter identifies the message.
// The |w_param| and |l_param| values are as per MSDN docs.
+ // The |handled| parameter is an output parameter which when set to false
+ // indicates that the message should be DefProc'ed.
// Returns the result of processing the message.
virtual LRESULT HandleNcHitTestMessage(unsigned int message,
WPARAM w_param,
- LPARAM l_param) = 0;
+ LPARAM l_param,
+ bool* handled) = 0;
+
+ // Handles the WM_SYSCOMMAND message
+ // The |message| parameter identifies the message.
+ // The |w_param| and |l_param| values are as per MSDN docs.
+ // The |handled| parameter is an output parameter which when set to false
+ // indicates that the message should be DefProc'ed.
+ // Returns the result of processing the message.
+ virtual LRESULT HandleSysCommand(unsigned int message,
+ WPARAM w_param,
+ LPARAM l_param,
+ bool* handled) = 0;
protected:
WindowEventTarget();
virtual ~WindowEventTarget();