1 // Copyright (c) 2011 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_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_
6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_
8 #include "base/compiler_specific.h"
9 #include "base/strings/string16.h"
10 #include "ui/gfx/geometry/point.h"
11 #include "ui/views/widget/tooltip_manager.h"
25 // TooltipManager implementation for Aura.
26 class TooltipManagerAura
: public TooltipManager
{
28 explicit TooltipManagerAura(Widget
* widget
);
29 ~TooltipManagerAura() override
;
31 // If |source| has capture this finds the Widget under the mouse and invokes
32 // UpdateTooltip() on it's TooltipManager. This is necessary as when capture
33 // is held mouse events are only delivered to the Window that has capture even
34 // though we may show tooltips for the Window under the mouse.
35 static void UpdateTooltipManagerForCapture(Widget
* source
);
37 // Returns the FontList used by all TooltipManagerAuras.
38 static const gfx::FontList
& GetDefaultFontList();
41 int GetMaxWidth(const gfx::Point
& location
,
42 aura::Window
* context
) const override
;
43 const gfx::FontList
& GetFontList() const override
;
44 void UpdateTooltip() override
;
45 void TooltipTextChanged(View
* view
) override
;
48 View
* GetViewUnderPoint(const gfx::Point
& point
);
49 void UpdateTooltipForTarget(View
* target
,
50 const gfx::Point
& point
,
51 aura::Window
* root_window
);
53 // Returns the Window the tooltip text is installed on.
54 aura::Window
* GetWindow();
57 base::string16 tooltip_text_
;
59 DISALLOW_COPY_AND_ASSIGN(TooltipManagerAura
);
64 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_