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 "content/browser/accessibility/browser_accessibility_manager_win.h" | 10 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 l_param = MAKELPARAM(mouse_coords.x, mouse_coords.y); | 217 l_param = MAKELPARAM(mouse_coords.x, mouse_coords.y); |
218 } | 218 } |
219 | 219 |
220 LRESULT ret = 0; | 220 LRESULT ret = 0; |
221 | 221 |
222 if (GetWindowEventTarget(GetParent())) { | 222 if (GetWindowEventTarget(GetParent())) { |
223 bool msg_handled = false; | 223 bool msg_handled = false; |
224 ret = GetWindowEventTarget(GetParent())->HandleMouseMessage( | 224 ret = GetWindowEventTarget(GetParent())->HandleMouseMessage( |
225 message, w_param, l_param, &msg_handled); | 225 message, w_param, l_param, &msg_handled); |
226 handled = msg_handled; | 226 handled = msg_handled; |
| 227 // If the parent did not handle non client mouse messages, we call |
| 228 // DefWindowProc on the message with the parent window handle. This |
| 229 // ensures that WM_SYSCOMMAND is generated for the parent and we are |
| 230 // out of the picture. |
| 231 if (!handled && |
| 232 (message >= WM_NCMOUSEMOVE && message <= WM_NCXBUTTONDBLCLK)) { |
| 233 ret = ::DefWindowProc(GetParent(), message, w_param, l_param); |
| 234 handled = TRUE; |
| 235 } |
227 } | 236 } |
228 return ret; | 237 return ret; |
229 } | 238 } |
230 | 239 |
231 LRESULT LegacyRenderWidgetHostHWND::OnMouseLeave(UINT message, | 240 LRESULT LegacyRenderWidgetHostHWND::OnMouseLeave(UINT message, |
232 WPARAM w_param, | 241 WPARAM w_param, |
233 LPARAM l_param) { | 242 LPARAM l_param) { |
234 mouse_tracking_enabled_ = false; | 243 mouse_tracking_enabled_ = false; |
235 LRESULT ret = 0; | 244 LRESULT ret = 0; |
236 if ((::GetCapture() != GetParent()) && GetWindowEventTarget(GetParent())) { | 245 if ((::GetCapture() != GetParent()) && GetWindowEventTarget(GetParent())) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // Additionally others check if the window WS_VSCROLL/WS_HSCROLL styles and | 364 // Additionally others check if the window WS_VSCROLL/WS_HSCROLL styles and |
356 // generate the legacy WM_VSCROLL/WM_HSCROLL messages. | 365 // generate the legacy WM_VSCROLL/WM_HSCROLL messages. |
357 // We add these styles to ensure that trackpad/trackpoint scrolling | 366 // We add these styles to ensure that trackpad/trackpoint scrolling |
358 // work. | 367 // work. |
359 long current_style = ::GetWindowLong(hwnd(), GWL_STYLE); | 368 long current_style = ::GetWindowLong(hwnd(), GWL_STYLE); |
360 ::SetWindowLong(hwnd(), GWL_STYLE, | 369 ::SetWindowLong(hwnd(), GWL_STYLE, |
361 current_style | WS_VSCROLL | WS_HSCROLL); | 370 current_style | WS_VSCROLL | WS_HSCROLL); |
362 return 0; | 371 return 0; |
363 } | 372 } |
364 | 373 |
365 LRESULT LegacyRenderWidgetHostHWND::OnSysCommand(UINT message, | |
366 WPARAM w_param, | |
367 LPARAM l_param) { | |
368 LRESULT ret = 0; | |
369 if (GetWindowEventTarget(GetParent())) { | |
370 bool msg_handled = false; | |
371 ret = GetWindowEventTarget( | |
372 GetParent())->HandleSysCommand(message, w_param, l_param, | |
373 &msg_handled); | |
374 SetMsgHandled(msg_handled); | |
375 } | |
376 return ret; | |
377 } | |
378 | |
379 } // namespace content | 374 } // namespace content |
OLD | NEW |