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 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 // Updates the tooltip if required (if there is any change in the tooltip | 78 // Updates the tooltip if required (if there is any change in the tooltip |
79 // text or the aura::Window. | 79 // text or the aura::Window. |
80 void UpdateIfRequired(); | 80 void UpdateIfRequired(); |
81 | 81 |
82 // Only used in tests. | 82 // Only used in tests. |
83 bool IsTooltipVisible(); | 83 bool IsTooltipVisible(); |
84 | 84 |
85 bool IsDragDropInProgress(); | 85 bool IsDragDropInProgress(); |
86 | 86 |
| 87 // This lazily creates the Tooltip instance so that the tooltip window will |
| 88 // be initialized with appropriate drop shadows. |
| 89 Tooltip* GetTooltip(); |
| 90 |
87 aura::client::DragDropClient* drag_drop_client_; | 91 aura::client::DragDropClient* drag_drop_client_; |
88 | 92 |
89 aura::Window* tooltip_window_; | 93 aura::Window* tooltip_window_; |
90 string16 tooltip_text_; | 94 string16 tooltip_text_; |
91 | 95 |
92 // These fields are for tracking state when the user presses a mouse button. | 96 // These fields are for tracking state when the user presses a mouse button. |
93 aura::Window* tooltip_window_at_mouse_press_; | 97 aura::Window* tooltip_window_at_mouse_press_; |
94 string16 tooltip_text_at_mouse_press_; | 98 string16 tooltip_text_at_mouse_press_; |
95 bool mouse_pressed_; | 99 bool mouse_pressed_; |
96 | 100 |
97 scoped_ptr<Tooltip> tooltip_; | 101 scoped_ptr<Tooltip> tooltip_; |
98 | 102 |
99 base::RepeatingTimer<TooltipController> tooltip_timer_; | 103 base::RepeatingTimer<TooltipController> tooltip_timer_; |
100 | 104 |
101 // Timer to timeout the life of an on-screen tooltip. We hide the tooltip when | 105 // Timer to timeout the life of an on-screen tooltip. We hide the tooltip when |
102 // this timer fires. | 106 // this timer fires. |
103 base::OneShotTimer<TooltipController> tooltip_shown_timer_; | 107 base::OneShotTimer<TooltipController> tooltip_shown_timer_; |
104 | 108 |
105 gfx::Point curr_mouse_loc_; | 109 gfx::Point curr_mouse_loc_; |
106 | 110 |
107 bool tooltips_enabled_; | 111 bool tooltips_enabled_; |
108 | 112 |
109 DISALLOW_COPY_AND_ASSIGN(TooltipController); | 113 DISALLOW_COPY_AND_ASSIGN(TooltipController); |
110 }; | 114 }; |
111 | 115 |
112 } // namespace internal | 116 } // namespace internal |
113 } // namespace ash | 117 } // namespace ash |
114 | 118 |
115 #endif // ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ | 119 #endif // ASH_TOOLTIPS_TOOLTIP_CONTROLLER_H_ |
OLD | NEW |