Chromium Code Reviews| Index: views/widget/widget_win.h |
| diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h |
| index 6130ad137ffbb4326670a19c6f2d9a572df243cc..b44027d931fb78bb9eb9c42f0f056ab488be1900 100644 |
| --- a/views/widget/widget_win.h |
| +++ b/views/widget/widget_win.h |
| @@ -139,8 +139,6 @@ class WidgetWin : public ui::WindowImpl, |
| virtual bool IsActive() const; |
| virtual bool IsAccessibleWidget() const; |
| virtual TooltipManager* GetTooltipManager(); |
| - virtual void GenerateMousePressedForView(View* view, |
| - const gfx::Point& point); |
| virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); |
| virtual Window* GetWindow(); |
| virtual const Window* GetWindow() const; |
| @@ -255,9 +253,34 @@ class WidgetWin : public ui::WindowImpl, |
| // Non-atlcrack.h handlers |
| MESSAGE_HANDLER_EX(WM_GETOBJECT, OnGetObject) |
| - MESSAGE_HANDLER_EX(WM_NCMOUSELEAVE, OnNCMouseLeave) |
| + |
| + // TODO(msw): Many of these handlers could go directly to ProcessMouse* |
| + // Unless they are actually overridder somewhere... (where?) |
| + // Mouse events. |
| + MESSAGE_HANDLER_EX(WM_LBUTTONDBLCLK, OnLButtonDblClk) |
|
Ben Goodger (Google)
2011/03/03 00:13:41
There is definitely room to consolidate all of thi
|
| + MESSAGE_HANDLER_EX(WM_LBUTTONDOWN, OnLButtonDown) |
| + MESSAGE_HANDLER_EX(WM_LBUTTONUP, OnLButtonUp) |
| + MESSAGE_HANDLER_EX(WM_MBUTTONDBLCLK, OnMButtonDblClk) |
| + MESSAGE_HANDLER_EX(WM_MBUTTONDOWN, OnMButtonDown) |
| + MESSAGE_HANDLER_EX(WM_MBUTTONUP, OnMButtonUp) |
| + MESSAGE_HANDLER_EX(WM_MOUSEACTIVATE, OnMouseActivate) |
| MESSAGE_HANDLER_EX(WM_MOUSELEAVE, OnMouseLeave) |
| + MESSAGE_HANDLER_EX(WM_MOUSEMOVE, OnMouseMove) |
| MESSAGE_HANDLER_EX(WM_MOUSEWHEEL, OnMouseWheel) |
| + MESSAGE_HANDLER_EX(WM_NCLBUTTONDBLCLK, OnNCLButtonDblClk) |
| + MESSAGE_HANDLER_EX(WM_NCLBUTTONDOWN, OnNCLButtonDown) |
| + MESSAGE_HANDLER_EX(WM_NCLBUTTONUP, OnNCLButtonUp) |
| + MESSAGE_HANDLER_EX(WM_NCMBUTTONDBLCLK, OnNCMButtonDblClk) |
| + MESSAGE_HANDLER_EX(WM_NCMBUTTONDOWN, OnNCMButtonDown) |
| + MESSAGE_HANDLER_EX(WM_NCMBUTTONUP, OnNCMButtonUp) |
| + MESSAGE_HANDLER_EX(WM_NCMOUSELEAVE, OnNCMouseLeave) |
| + MESSAGE_HANDLER_EX(WM_NCMOUSEMOVE, OnNCMouseMove) |
| + MESSAGE_HANDLER_EX(WM_NCRBUTTONDBLCLK, OnNCRButtonDblClk) |
| + MESSAGE_HANDLER_EX(WM_NCRBUTTONDOWN, OnNCRButtonDown) |
| + MESSAGE_HANDLER_EX(WM_NCRBUTTONUP, OnNCRButtonUp) |
| + MESSAGE_HANDLER_EX(WM_RBUTTONDBLCLK, OnRButtonDblClk) |
| + MESSAGE_HANDLER_EX(WM_RBUTTONDOWN, OnRButtonDown) |
| + MESSAGE_HANDLER_EX(WM_RBUTTONUP, OnRButtonUp) |
| // Key events. |
| MESSAGE_HANDLER_EX(WM_KEYDOWN, OnKeyDown) |
| @@ -286,36 +309,15 @@ class WidgetWin : public ui::WindowImpl, |
| MSG_WM_INITMENU(OnInitMenu) |
| MSG_WM_INITMENUPOPUP(OnInitMenuPopup) |
| MSG_WM_KILLFOCUS(OnKillFocus) |
| - MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk) |
| - MSG_WM_LBUTTONDOWN(OnLButtonDown) |
| - MSG_WM_LBUTTONUP(OnLButtonUp) |
| - MSG_WM_MBUTTONDOWN(OnMButtonDown) |
| - MSG_WM_MBUTTONUP(OnMButtonUp) |
| - MSG_WM_MBUTTONDBLCLK(OnMButtonDblClk) |
| - MSG_WM_MOUSEACTIVATE(OnMouseActivate) |
| - MSG_WM_MOUSEMOVE(OnMouseMove) |
| MSG_WM_MOVE(OnMove) |
| MSG_WM_MOVING(OnMoving) |
| MSG_WM_NCACTIVATE(OnNCActivate) |
| MSG_WM_NCCALCSIZE(OnNCCalcSize) |
| MSG_WM_NCHITTEST(OnNCHitTest) |
| - MSG_WM_NCMOUSEMOVE(OnNCMouseMove) |
| - MSG_WM_NCLBUTTONDBLCLK(OnNCLButtonDblClk) |
| - MSG_WM_NCLBUTTONDOWN(OnNCLButtonDown) |
| - MSG_WM_NCLBUTTONUP(OnNCLButtonUp) |
| - MSG_WM_NCMBUTTONDBLCLK(OnNCMButtonDblClk) |
| - MSG_WM_NCMBUTTONDOWN(OnNCMButtonDown) |
| - MSG_WM_NCMBUTTONUP(OnNCMButtonUp) |
| MSG_WM_NCPAINT(OnNCPaint) |
| - MSG_WM_NCRBUTTONDBLCLK(OnNCRButtonDblClk) |
| - MSG_WM_NCRBUTTONDOWN(OnNCRButtonDown) |
| - MSG_WM_NCRBUTTONUP(OnNCRButtonUp) |
| MSG_WM_NOTIFY(OnNotify) |
| MSG_WM_PAINT(OnPaint) |
| MSG_WM_POWERBROADCAST(OnPowerBroadcast) |
| - MSG_WM_RBUTTONDBLCLK(OnRButtonDblClk) |
| - MSG_WM_RBUTTONDOWN(OnRButtonDown) |
| - MSG_WM_RBUTTONUP(OnRButtonUp) |
| MSG_WM_SETFOCUS(OnSetFocus) |
| MSG_WM_SETICON(OnSetIcon) |
| MSG_WM_SETTEXT(OnSetText) |
| @@ -365,14 +367,14 @@ class WidgetWin : public ui::WindowImpl, |
| virtual LRESULT OnKeyDown(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual LRESULT OnKeyUp(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual void OnKillFocus(HWND focused_window); |
| - virtual void OnLButtonDblClk(UINT flags, const CPoint& point); |
| - virtual void OnLButtonDown(UINT flags, const CPoint& point); |
| - virtual void OnLButtonUp(UINT flags, const CPoint& point); |
| - virtual void OnMButtonDblClk(UINT flags, const CPoint& point); |
| - virtual void OnMButtonDown(UINT flags, const CPoint& point); |
| - virtual void OnMButtonUp(UINT flags, const CPoint& point); |
| - virtual LRESULT OnMouseActivate(HWND window, UINT hittest_code, UINT message); |
| - virtual void OnMouseMove(UINT flags, const CPoint& point); |
| + virtual LRESULT OnLButtonDblClk(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnLButtonDown(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnLButtonUp(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnMButtonDblClk(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnMButtonDown(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnMButtonUp(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnMouseActivate(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnMouseMove(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual LRESULT OnMouseLeave(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual LRESULT OnMouseWheel(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual void OnMove(const CPoint& point); |
| @@ -381,18 +383,24 @@ class WidgetWin : public ui::WindowImpl, |
| virtual LRESULT OnNCActivate(BOOL active); |
| virtual LRESULT OnNCCalcSize(BOOL w_param, LPARAM l_param); |
| virtual LRESULT OnNCHitTest(const CPoint& pt); |
| - virtual void OnNCLButtonDblClk(UINT flags, const CPoint& point); |
| - virtual void OnNCLButtonDown(UINT flags, const CPoint& point); |
| - virtual void OnNCLButtonUp(UINT flags, const CPoint& point); |
| - virtual void OnNCMButtonDblClk(UINT flags, const CPoint& point); |
| - virtual void OnNCMButtonDown(UINT flags, const CPoint& point); |
| - virtual void OnNCMButtonUp(UINT flags, const CPoint& point); |
| - virtual LRESULT OnNCMouseLeave(UINT uMsg, WPARAM w_param, LPARAM l_param); |
| - virtual LRESULT OnNCMouseMove(UINT flags, const CPoint& point); |
| + virtual LRESULT OnNCLButtonDblClk(UINT message, |
| + WPARAM w_param, |
| + LPARAM l_param); |
| + virtual LRESULT OnNCLButtonDown(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnNCLButtonUp(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnNCMButtonDblClk(UINT message, |
| + WPARAM w_param, |
| + LPARAM l_param); |
| + virtual LRESULT OnNCMButtonDown(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnNCMButtonUp(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnNCMouseLeave(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnNCMouseMove(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual void OnNCPaint(HRGN rgn); |
| - virtual void OnNCRButtonDblClk(UINT flags, const CPoint& point); |
| - virtual void OnNCRButtonDown(UINT flags, const CPoint& point); |
| - virtual void OnNCRButtonUp(UINT flags, const CPoint& point); |
| + virtual LRESULT OnNCRButtonDblClk(UINT message, |
| + WPARAM w_param, |
| + LPARAM l_param); |
| + virtual LRESULT OnNCRButtonDown(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnNCRButtonUp(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual LRESULT OnNCUAHDrawCaption(UINT msg, |
| WPARAM w_param, |
| LPARAM l_param); |
| @@ -400,9 +408,9 @@ class WidgetWin : public ui::WindowImpl, |
| virtual LRESULT OnNotify(int w_param, NMHDR* l_param); |
| virtual void OnPaint(HDC dc); |
| virtual LRESULT OnPowerBroadcast(DWORD power_event, DWORD data); |
| - virtual void OnRButtonDblClk(UINT flags, const CPoint& point); |
| - virtual void OnRButtonDown(UINT flags, const CPoint& point); |
| - virtual void OnRButtonUp(UINT flags, const CPoint& point); |
| + virtual LRESULT OnRButtonDblClk(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnRButtonDown(UINT message, WPARAM w_param, LPARAM l_param); |
| + virtual LRESULT OnRButtonUp(UINT message, WPARAM w_param, LPARAM l_param); |
| virtual LRESULT OnReflectedMessage(UINT msg, WPARAM w_param, LPARAM l_param); |
| virtual void OnSetFocus(HWND focused_window); |
| virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon); |
| @@ -429,13 +437,11 @@ class WidgetWin : public ui::WindowImpl, |
| // Actually handle mouse events. These functions are called by subclasses who |
| // override the message handlers above to do the actual real work of handling |
| // the event in the View system. |
| - bool ProcessMousePressed(const CPoint& point, |
| - UINT flags, |
| - bool dbl_click, |
| - bool non_client); |
| - void ProcessMouseDragged(const CPoint& point, UINT flags); |
| - void ProcessMouseReleased(const CPoint& point, UINT flags); |
| - void ProcessMouseMoved(const CPoint& point, UINT flags, bool is_nonclient); |
| + bool ProcessMousePressed(UINT message, WPARAM w_param, LPARAM l_param); |
| + // TODO(msw): ProcessMouseDragged could be made class/file private. |
| + void ProcessMouseDragged(UINT message, WPARAM w_param, LPARAM l_param); |
| + void ProcessMouseReleased(UINT message, WPARAM w_param, LPARAM l_param); |
| + void ProcessMouseMoved(UINT message, WPARAM w_param, LPARAM l_param); |
| void ProcessMouseExited(); |
| // Lays out the root view to fit the appropriate area within the widget. |