OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/corewm/tooltip_win.h" | 5 #include "ui/views/corewm/tooltip_win.h" |
6 | 6 |
7 #include <winuser.h> | 7 #include <winuser.h> |
8 | 8 |
9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 if (!EnsureTooltipWindow()) | 127 if (!EnsureTooltipWindow()) |
128 return; | 128 return; |
129 | 129 |
130 SendMessage(tooltip_hwnd_, TTM_TRACKACTIVATE, | 130 SendMessage(tooltip_hwnd_, TTM_TRACKACTIVATE, |
131 TRUE, reinterpret_cast<LPARAM>(&toolinfo_)); | 131 TRUE, reinterpret_cast<LPARAM>(&toolinfo_)); |
132 SetWindowPos(tooltip_hwnd_, HWND_TOPMOST, 0, 0, 0, 0, | 132 SetWindowPos(tooltip_hwnd_, HWND_TOPMOST, 0, 0, 0, 0, |
133 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOSIZE); | 133 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOSIZE); |
134 } | 134 } |
135 | 135 |
136 void TooltipWin::Hide() { | 136 void TooltipWin::Hide() { |
137 if (!EnsureTooltipWindow()) | 137 if (!tooltip_hwnd_) |
138 return; | 138 return; |
139 | 139 |
140 SendMessage(tooltip_hwnd_, TTM_TRACKACTIVATE, FALSE, | 140 SendMessage(tooltip_hwnd_, TTM_TRACKACTIVATE, FALSE, |
141 reinterpret_cast<LPARAM>(&toolinfo_)); | 141 reinterpret_cast<LPARAM>(&toolinfo_)); |
142 } | 142 } |
143 | 143 |
144 bool TooltipWin::IsVisible() { | 144 bool TooltipWin::IsVisible() { |
145 return showing_; | 145 return showing_; |
146 } | 146 } |
147 | 147 |
148 } // namespace corewm | 148 } // namespace corewm |
149 } // namespace views | 149 } // namespace views |
OLD | NEW |