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/widget/aero_tooltip_manager.h" | 5 #include "ui/views/widget/aero_tooltip_manager.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <commctrl.h> | 8 #include <commctrl.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 gfx::Point mouse_pos = gfx::win::ScreenToDIPPoint(mouse_pos_in_pixels); | 45 gfx::Point mouse_pos = gfx::win::ScreenToDIPPoint(mouse_pos_in_pixels); |
46 if (u_msg == WM_NCMOUSEMOVE) { | 46 if (u_msg == WM_NCMOUSEMOVE) { |
47 // NC message coordinates are in screen coordinates. | 47 // NC message coordinates are in screen coordinates. |
48 POINT temp = mouse_pos_in_pixels.ToPOINT(); | 48 POINT temp = mouse_pos_in_pixels.ToPOINT(); |
49 ::MapWindowPoints(HWND_DESKTOP, GetParent(), &temp, 1); | 49 ::MapWindowPoints(HWND_DESKTOP, GetParent(), &temp, 1); |
50 mouse_pos_in_pixels.SetPoint(temp.x, temp.y); | 50 mouse_pos_in_pixels.SetPoint(temp.x, temp.y); |
51 mouse_pos = gfx::win::ScreenToDIPPoint(mouse_pos_in_pixels); | 51 mouse_pos = gfx::win::ScreenToDIPPoint(mouse_pos_in_pixels); |
52 } | 52 } |
53 if (last_mouse_pos_ != mouse_pos) { | 53 if (last_mouse_pos_ != mouse_pos) { |
54 last_mouse_pos_ = mouse_pos; | 54 last_mouse_pos_ = mouse_pos; |
55 HideKeyboardTooltip(); | |
56 UpdateTooltip(mouse_pos); | 55 UpdateTooltip(mouse_pos); |
57 } | 56 } |
58 | 57 |
59 // Delay opening of the tooltip just in case the user moves their | 58 // Delay opening of the tooltip just in case the user moves their |
60 // mouse to another control. We defer this from Init because we get | 59 // mouse to another control. We defer this from Init because we get |
61 // zero if we query it too soon. | 60 // zero if we query it too soon. |
62 if (!initial_delay_) { | 61 if (!initial_delay_) { |
63 initial_delay_ = static_cast<int>( | 62 initial_delay_ = static_cast<int>( |
64 ::SendMessage(tooltip_hwnd_, TTM_GETDELAYTIME, TTDT_INITIAL, 0)); | 63 ::SendMessage(tooltip_hwnd_, TTM_GETDELAYTIME, TTDT_INITIAL, 0)); |
65 } | 64 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void AeroTooltipManager::InitialTimer::Disown() { | 106 void AeroTooltipManager::InitialTimer::Disown() { |
108 manager_ = NULL; | 107 manager_ = NULL; |
109 } | 108 } |
110 | 109 |
111 void AeroTooltipManager::InitialTimer::Execute() { | 110 void AeroTooltipManager::InitialTimer::Execute() { |
112 if (manager_) | 111 if (manager_) |
113 manager_->OnTimer(); | 112 manager_->OnTimer(); |
114 } | 113 } |
115 | 114 |
116 } // namespace views | 115 } // namespace views |
OLD | NEW |