OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/win/hwnd_message_handler.h" | 5 #include "ui/views/win/hwnd_message_handler.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <oleacc.h> | 8 #include <oleacc.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <wtsapi32.h> | 10 #include <wtsapi32.h> |
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2379 // be WM_RBUTTONUP instead of WM_NCRBUTTONUP. | 2379 // be WM_RBUTTONUP instead of WM_NCRBUTTONUP. |
2380 SetCapture(); | 2380 SetCapture(); |
2381 } | 2381 } |
2382 long message_time = GetMessageTime(); | 2382 long message_time = GetMessageTime(); |
2383 MSG msg = { hwnd(), message, w_param, l_param, message_time, | 2383 MSG msg = { hwnd(), message, w_param, l_param, message_time, |
2384 { CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param) } }; | 2384 { CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param) } }; |
2385 ui::MouseEvent event(msg); | 2385 ui::MouseEvent event(msg); |
2386 if (IsSynthesizedMouseMessage(message, message_time, l_param)) | 2386 if (IsSynthesizedMouseMessage(message, message_time, l_param)) |
2387 event.set_flags(event.flags() | ui::EF_FROM_TOUCH); | 2387 event.set_flags(event.flags() | ui::EF_FROM_TOUCH); |
2388 | 2388 |
2389 if (!(event.flags() & ui::EF_IS_NON_CLIENT)) | |
2390 delegate_->HandleTooltipMouseMove(message, w_param, l_param); | |
2391 | |
2392 if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture() && track_mouse) { | 2389 if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture() && track_mouse) { |
2393 // Windows only fires WM_MOUSELEAVE events if the application begins | 2390 // Windows only fires WM_MOUSELEAVE events if the application begins |
2394 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. | 2391 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. |
2395 // We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE. | 2392 // We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE. |
2396 TrackMouseEvents((message == WM_NCMOUSEMOVE) ? | 2393 TrackMouseEvents((message == WM_NCMOUSEMOVE) ? |
2397 TME_NONCLIENT | TME_LEAVE : TME_LEAVE); | 2394 TME_NONCLIENT | TME_LEAVE : TME_LEAVE); |
2398 } else if (event.type() == ui::ET_MOUSE_EXITED) { | 2395 } else if (event.type() == ui::ET_MOUSE_EXITED) { |
2399 // Reset our tracking flags so future mouse movement over this | 2396 // Reset our tracking flags so future mouse movement over this |
2400 // NativeWidget results in a new tracking session. Fall through for | 2397 // NativeWidget results in a new tracking session. Fall through for |
2401 // OnMouseEvent. | 2398 // OnMouseEvent. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 POINT cursor_pos = {0}; | 2440 POINT cursor_pos = {0}; |
2444 ::GetCursorPos(&cursor_pos); | 2441 ::GetCursorPos(&cursor_pos); |
2445 if (memcmp(&cursor_pos, &mouse_location, sizeof(POINT))) | 2442 if (memcmp(&cursor_pos, &mouse_location, sizeof(POINT))) |
2446 return false; | 2443 return false; |
2447 return true; | 2444 return true; |
2448 } | 2445 } |
2449 return false; | 2446 return false; |
2450 } | 2447 } |
2451 | 2448 |
2452 } // namespace views | 2449 } // namespace views |
OLD | NEW |