| 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 UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ | 5 #ifndef UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ |
| 6 #define UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ | 6 #define UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ |
| 7 | 7 |
| 8 #include "ui/aura/aura_export.h" | 8 #include "ui/aura/aura_export.h" |
| 9 #include "ui/gfx/font.h" | 9 #include "ui/gfx/font.h" |
| 10 | 10 |
| 11 namespace gfx { |
| 12 class Point; |
| 13 } |
| 14 |
| 11 namespace aura { | 15 namespace aura { |
| 12 class Window; | 16 class Window; |
| 13 namespace client { | 17 namespace client { |
| 14 | 18 |
| 15 class ScopedTooltipDisabler; | 19 class ScopedTooltipDisabler; |
| 16 | 20 |
| 17 class AURA_EXPORT TooltipClient { | 21 class AURA_EXPORT TooltipClient { |
| 18 public: | 22 public: |
| 23 // Returns the max width of the tooltip when shown at the specified location. |
| 24 virtual int GetMaxWidth(const gfx::Point& point, |
| 25 aura::Window* context) const = 0; |
| 26 |
| 19 // Informs the shell tooltip manager of change in tooltip for window |target|. | 27 // Informs the shell tooltip manager of change in tooltip for window |target|. |
| 20 virtual void UpdateTooltip(Window* target) = 0; | 28 virtual void UpdateTooltip(Window* target) = 0; |
| 21 | 29 |
| 22 // Sets the time after which the tooltip is hidden for Window |target|. If | 30 // Sets the time after which the tooltip is hidden for Window |target|. If |
| 23 // |timeout_in_ms| is <= 0, the tooltip is shown indefinitely. | 31 // |timeout_in_ms| is <= 0, the tooltip is shown indefinitely. |
| 24 virtual void SetTooltipShownTimeout(Window* target, int timeout_in_ms) = 0; | 32 virtual void SetTooltipShownTimeout(Window* target, int timeout_in_ms) = 0; |
| 25 | 33 |
| 26 protected: | 34 protected: |
| 27 // Enables/Disables tooltips. This is treated as a reference count. Consumers | 35 // Enables/Disables tooltips. This is treated as a reference count. Consumers |
| 28 // must use ScopedTooltipDisabler to enable/disabled tooltips. | 36 // must use ScopedTooltipDisabler to enable/disabled tooltips. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 42 AURA_EXPORT void SetTooltipText(Window* window, | 50 AURA_EXPORT void SetTooltipText(Window* window, |
| 43 base::string16* tooltip_text); | 51 base::string16* tooltip_text); |
| 44 AURA_EXPORT void SetTooltipId(Window* window, void* id); | 52 AURA_EXPORT void SetTooltipId(Window* window, void* id); |
| 45 AURA_EXPORT const base::string16 GetTooltipText(Window* window); | 53 AURA_EXPORT const base::string16 GetTooltipText(Window* window); |
| 46 AURA_EXPORT const void* GetTooltipId(Window* window); | 54 AURA_EXPORT const void* GetTooltipId(Window* window); |
| 47 | 55 |
| 48 } // namespace client | 56 } // namespace client |
| 49 } // namespace aura | 57 } // namespace aura |
| 50 | 58 |
| 51 #endif // UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ | 59 #endif // UI_WM_PUBLIC_TOOLTIP_CLIENT_H_ |
| OLD | NEW |