Index: chrome/views/widget/widget_win.cc |
=================================================================== |
--- chrome/views/widget/widget_win.cc (revision 12565) |
+++ chrome/views/widget/widget_win.cc (working copy) |
@@ -520,7 +520,7 @@ |
} |
void WidgetWin::OnLButtonDown(UINT flags, const CPoint& point) { |
- ProcessMousePressed(point, flags | MK_LBUTTON, false); |
+ ProcessMousePressed(point, flags | MK_LBUTTON, false, false); |
} |
void WidgetWin::OnLButtonUp(UINT flags, const CPoint& point) { |
@@ -528,11 +528,11 @@ |
} |
void WidgetWin::OnLButtonDblClk(UINT flags, const CPoint& point) { |
- ProcessMousePressed(point, flags | MK_LBUTTON, true); |
+ ProcessMousePressed(point, flags | MK_LBUTTON, true, false); |
} |
void WidgetWin::OnMButtonDown(UINT flags, const CPoint& point) { |
- ProcessMousePressed(point, flags | MK_MBUTTON, false); |
+ ProcessMousePressed(point, flags | MK_MBUTTON, false, false); |
} |
void WidgetWin::OnMButtonUp(UINT flags, const CPoint& point) { |
@@ -540,7 +540,7 @@ |
} |
void WidgetWin::OnMButtonDblClk(UINT flags, const CPoint& point) { |
- ProcessMousePressed(point, flags | MK_MBUTTON, true); |
+ ProcessMousePressed(point, flags | MK_MBUTTON, true, false); |
} |
LRESULT WidgetWin::OnMouseActivate(HWND window, UINT hittest_code, |
@@ -582,11 +582,11 @@ |
} |
void WidgetWin::OnNCLButtonDblClk(UINT flags, const CPoint& point) { |
- SetMsgHandled(FALSE); |
+ SetMsgHandled(ProcessMousePressed(point, flags | MK_LBUTTON, true, true)); |
} |
void WidgetWin::OnNCLButtonDown(UINT flags, const CPoint& point) { |
- SetMsgHandled(FALSE); |
+ SetMsgHandled(ProcessMousePressed(point, flags | MK_LBUTTON, false, true)); |
} |
void WidgetWin::OnNCLButtonUp(UINT flags, const CPoint& point) { |
@@ -594,11 +594,11 @@ |
} |
void WidgetWin::OnNCMButtonDblClk(UINT flags, const CPoint& point) { |
- SetMsgHandled(FALSE); |
+ SetMsgHandled(ProcessMousePressed(point, flags | MK_MBUTTON, true, true)); |
} |
void WidgetWin::OnNCMButtonDown(UINT flags, const CPoint& point) { |
- SetMsgHandled(FALSE); |
+ SetMsgHandled(ProcessMousePressed(point, flags | MK_MBUTTON, false, true)); |
} |
void WidgetWin::OnNCMButtonUp(UINT flags, const CPoint& point) { |
@@ -623,11 +623,11 @@ |
} |
void WidgetWin::OnNCRButtonDblClk(UINT flags, const CPoint& point) { |
- SetMsgHandled(FALSE); |
+ SetMsgHandled(ProcessMousePressed(point, flags | MK_RBUTTON, true, true)); |
} |
void WidgetWin::OnNCRButtonDown(UINT flags, const CPoint& point) { |
- SetMsgHandled(FALSE); |
+ SetMsgHandled(ProcessMousePressed(point, flags | MK_RBUTTON, false, true)); |
} |
void WidgetWin::OnNCRButtonUp(UINT flags, const CPoint& point) { |
@@ -653,7 +653,7 @@ |
} |
void WidgetWin::OnRButtonDown(UINT flags, const CPoint& point) { |
- ProcessMousePressed(point, flags | MK_RBUTTON, false); |
+ ProcessMousePressed(point, flags | MK_RBUTTON, false, false); |
} |
void WidgetWin::OnRButtonUp(UINT flags, const CPoint& point) { |
@@ -661,7 +661,7 @@ |
} |
void WidgetWin::OnRButtonDblClk(UINT flags, const CPoint& point) { |
- ProcessMousePressed(point, flags | MK_RBUTTON, true); |
+ ProcessMousePressed(point, flags | MK_RBUTTON, true, false); |
} |
void WidgetWin::OnSettingChange(UINT flags, const wchar_t* section) { |
@@ -712,16 +712,21 @@ |
} |
} |
-bool WidgetWin::ProcessMousePressed(const CPoint& point, UINT flags, |
- bool dbl_click) { |
+bool WidgetWin::ProcessMousePressed(const CPoint& point, |
+ UINT flags, |
+ bool dbl_click, |
+ bool non_client) { |
last_mouse_event_was_move_ = false; |
// Windows gives screen coordinates for nonclient events, while the RootView |
// expects window coordinates; convert if necessary. |
gfx::Point converted_point(point); |
+ if (non_client) |
+ View::ConvertPointToView(NULL, root_view_.get(), &converted_point); |
MouseEvent mouse_pressed(Event::ET_MOUSE_PRESSED, |
converted_point.x(), |
converted_point.y(), |
(dbl_click ? MouseEvent::EF_IS_DOUBLE_CLICK : 0) | |
+ (non_client ? MouseEvent::EF_IS_NON_CLIENT : 0) | |
Event::ConvertWindowsFlags(flags)); |
if (root_view_->OnMousePressed(mouse_pressed)) { |
is_mouse_down_ = true; |