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