Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / ui / wm / public / tooltip_client.h
blobf592b21a18a5ef4072a3e139907419e4c4340366
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
3 // found in the LICENSE file.
5 #ifndef UI_WM_PUBLIC_TOOLTIP_CLIENT_H_
6 #define UI_WM_PUBLIC_TOOLTIP_CLIENT_H_
8 #include "ui/aura/aura_export.h"
9 #include "ui/gfx/font.h"
11 namespace aura {
12 class Window;
13 namespace client {
15 class ScopedTooltipDisabler;
17 class AURA_EXPORT TooltipClient {
18 public:
19 // Informs the shell tooltip manager of change in tooltip for window |target|.
20 virtual void UpdateTooltip(Window* target) = 0;
22 // Sets the time after which the tooltip is hidden for Window |target|. If
23 // |timeout_in_ms| is <= 0, the tooltip is shown indefinitely.
24 virtual void SetTooltipShownTimeout(Window* target, int timeout_in_ms) = 0;
26 protected:
27 // Enables/Disables tooltips. This is treated as a reference count. Consumers
28 // must use ScopedTooltipDisabler to enable/disabled tooltips.
29 virtual void SetTooltipsEnabled(bool enable) = 0;
31 private:
32 friend class ScopedTooltipDisabler;
35 AURA_EXPORT void SetTooltipClient(Window* root_window,
36 TooltipClient* client);
37 AURA_EXPORT TooltipClient* GetTooltipClient(Window* root_window);
39 AURA_EXPORT void SetTooltipText(Window* window, base::string16* tooltip_text);
40 AURA_EXPORT const base::string16 GetTooltipText(Window* window);
42 } // namespace client
43 } // namespace aura
45 #endif // UI_WM_PUBLIC_TOOLTIP_CLIENT_H_