| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" | 5 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "base/win/win_util.h" | 10 #include "base/win/win_util.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 TRACKMOUSEEVENT tme; | 148 TRACKMOUSEEVENT tme; |
| 149 tme.cbSize = sizeof(tme); | 149 tme.cbSize = sizeof(tme); |
| 150 tme.dwFlags = TME_LEAVE; | 150 tme.dwFlags = TME_LEAVE; |
| 151 tme.hwndTrack = hwnd(); | 151 tme.hwndTrack = hwnd(); |
| 152 tme.dwHoverTime = 0; | 152 tme.dwHoverTime = 0; |
| 153 TrackMouseEvent(&tme); | 153 TrackMouseEvent(&tme); |
| 154 } | 154 } |
| 155 w_param = MAKEWPARAM(LOWORD(w_param), SPECIAL_MOUSEMOVE_NOT_TO_BE_TRACKED); | 155 w_param = MAKEWPARAM(LOWORD(w_param), SPECIAL_MOUSEMOVE_NOT_TO_BE_TRACKED); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // The offsets in mouse wheel messages are in screen coordinates. We should | 158 // The offsets for WM_NCXXX and WM_MOUSEWHEEL and WM_MOUSEHWHEEL messages are |
| 159 // not be converting them to parent coordinates. | 159 // in screen coordinates. We should not be converting them to parent |
| 160 if (message != WM_MOUSEWHEEL && message != WM_MOUSEHWHEEL) { | 160 // coordinates. |
| 161 if ((message >= WM_MOUSEFIRST && message <= WM_MOUSELAST) && |
| 162 (message != WM_MOUSEWHEEL && message != WM_MOUSEHWHEEL)) { |
| 161 POINT mouse_coords; | 163 POINT mouse_coords; |
| 162 mouse_coords.x = GET_X_LPARAM(l_param); | 164 mouse_coords.x = GET_X_LPARAM(l_param); |
| 163 mouse_coords.y = GET_Y_LPARAM(l_param); | 165 mouse_coords.y = GET_Y_LPARAM(l_param); |
| 164 ::MapWindowPoints(hwnd(), GetParent(), &mouse_coords, 1); | 166 ::MapWindowPoints(hwnd(), GetParent(), &mouse_coords, 1); |
| 165 l_param = MAKELPARAM(mouse_coords.x, mouse_coords.y); | 167 l_param = MAKELPARAM(mouse_coords.x, mouse_coords.y); |
| 166 } | 168 } |
| 167 return ::SendMessage(GetParent(), message, w_param, l_param); | 169 return ::SendMessage(GetParent(), message, w_param, l_param); |
| 168 } | 170 } |
| 169 | 171 |
| 170 LRESULT LegacyRenderWidgetHostHWND::OnMouseLeave(UINT message, | 172 LRESULT LegacyRenderWidgetHostHWND::OnMouseLeave(UINT message, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 LPARAM l_param) { | 205 LPARAM l_param) { |
| 204 return ::SendMessage(GetParent(), message, w_param, l_param); | 206 return ::SendMessage(GetParent(), message, w_param, l_param); |
| 205 } | 207 } |
| 206 | 208 |
| 207 LRESULT LegacyRenderWidgetHostHWND::OnScroll(UINT message, | 209 LRESULT LegacyRenderWidgetHostHWND::OnScroll(UINT message, |
| 208 WPARAM w_param, | 210 WPARAM w_param, |
| 209 LPARAM l_param) { | 211 LPARAM l_param) { |
| 210 return ::SendMessage(GetParent(), message, w_param, l_param); | 212 return ::SendMessage(GetParent(), message, w_param, l_param); |
| 211 } | 213 } |
| 212 | 214 |
| 215 LRESULT LegacyRenderWidgetHostHWND::OnNCHitTest(UINT message, |
| 216 WPARAM w_param, |
| 217 LPARAM l_param) { |
| 218 return ::SendMessage(GetParent(), message, w_param, l_param); |
| 219 } |
| 220 |
| 213 LRESULT LegacyRenderWidgetHostHWND::OnNCPaint(UINT message, | 221 LRESULT LegacyRenderWidgetHostHWND::OnNCPaint(UINT message, |
| 214 WPARAM w_param, | 222 WPARAM w_param, |
| 215 LPARAM l_param) { | 223 LPARAM l_param) { |
| 216 return 0; | 224 return 0; |
| 217 } | 225 } |
| 218 | 226 |
| 219 LRESULT LegacyRenderWidgetHostHWND::OnPaint(UINT message, | 227 LRESULT LegacyRenderWidgetHostHWND::OnPaint(UINT message, |
| 220 WPARAM w_param, | 228 WPARAM w_param, |
| 221 LPARAM l_param) { | 229 LPARAM l_param) { |
| 222 PAINTSTRUCT ps = {0}; | 230 PAINTSTRUCT ps = {0}; |
| 223 ::BeginPaint(hwnd(), &ps); | 231 ::BeginPaint(hwnd(), &ps); |
| 224 ::EndPaint(hwnd(), &ps); | 232 ::EndPaint(hwnd(), &ps); |
| 225 return 0; | 233 return 0; |
| 226 } | 234 } |
| 227 | 235 |
| 228 LRESULT LegacyRenderWidgetHostHWND::OnSetCursor(UINT message, | 236 LRESULT LegacyRenderWidgetHostHWND::OnSetCursor(UINT message, |
| 229 WPARAM w_param, | 237 WPARAM w_param, |
| 230 LPARAM l_param) { | 238 LPARAM l_param) { |
| 231 return 0; | 239 return 0; |
| 232 } | 240 } |
| 233 | 241 |
| 234 } // namespace content | 242 } // namespace content |
| OLD | NEW |