| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ | 5 #ifndef UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ |
| 6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ | 6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Invoked when the tooltip text changes for the specified views. | 46 // Invoked when the tooltip text changes for the specified views. |
| 47 virtual void TooltipTextChanged(View* view) = 0; | 47 virtual void TooltipTextChanged(View* view) = 0; |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 // Trims the tooltip to fit, setting |text| to the clipped result, | 50 // Trims the tooltip to fit, setting |text| to the clipped result, |
| 51 // |max_width| to the width (in pixels) of the clipped text and |line_count| | 51 // |max_width| to the width (in pixels) of the clipped text and |line_count| |
| 52 // to the number of lines of text in the tooltip. |x| and |y| give the | 52 // to the number of lines of text in the tooltip. |x| and |y| give the |
| 53 // location of the tooltip in screen coordinates. |context| is used to | 53 // location of the tooltip in screen coordinates. |context| is used to |
| 54 // determine which gfx::Screen should be used. | 54 // determine which gfx::Screen should be used. |
| 55 static void TrimTooltipToFit(string16* text, | 55 static void TrimTooltipToFit(string16* text, |
| 56 int* max_width, | 56 float* max_width, |
| 57 int* line_count, | 57 int* line_count, |
| 58 int x, | 58 int x, |
| 59 int y, | 59 int y, |
| 60 gfx::NativeView context); | 60 gfx::NativeView context); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace views | 63 } // namespace views |
| 64 | 64 |
| 65 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ | 65 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ |
| OLD | NEW |