OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_ | 5 #ifndef VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_ |
6 #define VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_ | 6 #define VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <commctrl.h> | 9 #include <commctrl.h> |
10 #include <string> | 10 #include <string> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 private: | 102 private: |
103 // Sets the tooltip position based on the x/y position of the text. If the | 103 // Sets the tooltip position based on the x/y position of the text. If the |
104 // tooltip fits, true is returned. | 104 // tooltip fits, true is returned. |
105 bool SetTooltipPosition(int text_x, int text_y); | 105 bool SetTooltipPosition(int text_x, int text_y); |
106 | 106 |
107 // Calculates the preferred height for tooltips. This always returns a | 107 // Calculates the preferred height for tooltips. This always returns a |
108 // positive value. | 108 // positive value. |
109 int CalcTooltipHeight(); | 109 int CalcTooltipHeight(); |
110 | 110 |
111 // Trims the tooltip to fit, setting text to the clipped result, width to the | |
112 // width (in pixels) of the clipped text and line_count to the number of lines | |
113 // of text in the tooltip. | |
114 void TrimTooltipToFit(std::wstring* text, | |
115 int* width, | |
116 int* line_count, | |
117 int position_x, | |
118 int position_y, | |
119 HWND window); | |
120 | |
121 // Invoked when the timer elapses and tooltip has to be destroyed. | 111 // Invoked when the timer elapses and tooltip has to be destroyed. |
122 void DestroyKeyboardTooltipWindow(HWND window_to_destroy); | 112 void DestroyKeyboardTooltipWindow(HWND window_to_destroy); |
123 | 113 |
124 // Hosting Widget. | 114 // Hosting Widget. |
125 Widget* widget_; | 115 Widget* widget_; |
126 | 116 |
127 // The View the mouse is under. This is null if the mouse isn't under a | 117 // The View the mouse is under. This is null if the mouse isn't under a |
128 // View. | 118 // View. |
129 View* last_tooltip_view_; | 119 View* last_tooltip_view_; |
130 | 120 |
(...skipping 20 matching lines...) Expand all Loading... |
151 // Used to register DestroyTooltipWindow function with PostDelayedTask | 141 // Used to register DestroyTooltipWindow function with PostDelayedTask |
152 // function. | 142 // function. |
153 ScopedRunnableMethodFactory<TooltipManagerWin> keyboard_tooltip_factory_; | 143 ScopedRunnableMethodFactory<TooltipManagerWin> keyboard_tooltip_factory_; |
154 | 144 |
155 DISALLOW_COPY_AND_ASSIGN(TooltipManagerWin); | 145 DISALLOW_COPY_AND_ASSIGN(TooltipManagerWin); |
156 }; | 146 }; |
157 | 147 |
158 } // namespace views | 148 } // namespace views |
159 | 149 |
160 #endif // VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_ | 150 #endif // VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_ |
OLD | NEW |