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 #ifndef ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ | 5 #ifndef ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ |
6 #define ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ | 6 #define ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 aura::GestureEvent* event) OVERRIDE; | 53 aura::GestureEvent* event) OVERRIDE; |
54 | 54 |
55 // Overridden from aura::WindowObserver. | 55 // Overridden from aura::WindowObserver. |
56 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 56 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |
57 | 57 |
58 private: | 58 private: |
59 friend class ash::test::TooltipControllerTest; | 59 friend class ash::test::TooltipControllerTest; |
60 | 60 |
61 class Tooltip; | 61 class Tooltip; |
62 | 62 |
| 63 // Trims the tooltip to fit, setting |text| to the clipped result, |
| 64 // |max_width| to the width (in pixels) of the clipped text and |line_count| |
| 65 // to the number of lines of text in the tooltip. |x| and |y| give the |
| 66 // location of the tooltip in screen coordinates. |
| 67 static void TrimTooltipToFit(string16* text, |
| 68 int* max_width, |
| 69 int* line_count, |
| 70 int x, |
| 71 int y); |
| 72 |
63 void TooltipTimerFired(); | 73 void TooltipTimerFired(); |
64 | 74 |
65 // Updates the tooltip if required (if there is any change in the tooltip | 75 // Updates the tooltip if required (if there is any change in the tooltip |
66 // text or the aura::Window. | 76 // text or the aura::Window. |
67 void UpdateIfRequired(); | 77 void UpdateIfRequired(); |
68 | 78 |
69 // Only used in tests. | 79 // Only used in tests. |
70 bool IsTooltipVisible(); | 80 bool IsTooltipVisible(); |
71 | 81 |
72 bool IsDragDropInProgress(); | 82 bool IsDragDropInProgress(); |
(...skipping 14 matching lines...) Expand all Loading... |
87 | 97 |
88 bool tooltips_enabled_; | 98 bool tooltips_enabled_; |
89 | 99 |
90 DISALLOW_COPY_AND_ASSIGN(TooltipController); | 100 DISALLOW_COPY_AND_ASSIGN(TooltipController); |
91 }; | 101 }; |
92 | 102 |
93 } // namespace internal | 103 } // namespace internal |
94 } // namespace ash | 104 } // namespace ash |
95 | 105 |
96 #endif // ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ | 106 #endif // ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ |
OLD | NEW |