OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ | 5 #ifndef UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ |
6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ | 6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
11 #include "ui/views/widget/tooltip_manager.h" | 11 #include "ui/views/widget/tooltip_manager.h" |
12 | 12 |
13 namespace aura { | 13 namespace aura { |
14 class RootWindow; | |
15 class Window; | 14 class Window; |
16 } | 15 } |
17 | 16 |
18 namespace gfx { | 17 namespace gfx { |
19 class FontList; | 18 class FontList; |
20 } | 19 } |
21 | 20 |
22 namespace views { | 21 namespace views { |
23 | 22 |
24 class Widget; | 23 class Widget; |
25 | 24 |
26 // TooltipManager implementation for Aura. | 25 // TooltipManager implementation for Aura. |
27 class TooltipManagerAura : public TooltipManager { | 26 class TooltipManagerAura : public TooltipManager { |
28 public: | 27 public: |
29 TooltipManagerAura(aura::Window* window, Widget* widget); | 28 TooltipManagerAura(aura::Window* window, Widget* widget); |
30 virtual ~TooltipManagerAura(); | 29 virtual ~TooltipManagerAura(); |
31 | 30 |
32 // Returns the FontList used by all TooltipManagerAuras. | 31 // Returns the FontList used by all TooltipManagerAuras. |
33 static const gfx::FontList& GetDefaultFontList(); | 32 static const gfx::FontList& GetDefaultFontList(); |
34 | 33 |
35 // TooltipManager: | 34 // TooltipManager: |
36 virtual const gfx::FontList& GetFontList() const OVERRIDE; | 35 virtual const gfx::FontList& GetFontList() const OVERRIDE; |
37 virtual void UpdateTooltip() OVERRIDE; | 36 virtual void UpdateTooltip() OVERRIDE; |
38 virtual void TooltipTextChanged(View* view) OVERRIDE; | 37 virtual void TooltipTextChanged(View* view) OVERRIDE; |
39 | 38 |
40 private: | 39 private: |
41 View* GetViewUnderPoint(const gfx::Point& point); | 40 View* GetViewUnderPoint(const gfx::Point& point); |
42 void UpdateTooltipForTarget(View* target, | 41 void UpdateTooltipForTarget(View* target, |
43 const gfx::Point& point, | 42 const gfx::Point& point, |
44 aura::RootWindow* root_window); | 43 aura::Window* root_window); |
45 | 44 |
46 aura::Window* window_; | 45 aura::Window* window_; |
47 Widget* widget_; | 46 Widget* widget_; |
48 string16 tooltip_text_; | 47 string16 tooltip_text_; |
49 | 48 |
50 DISALLOW_COPY_AND_ASSIGN(TooltipManagerAura); | 49 DISALLOW_COPY_AND_ASSIGN(TooltipManagerAura); |
51 }; | 50 }; |
52 | 51 |
53 } // namespace views | 52 } // namespace views |
54 | 53 |
55 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ | 54 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_AURA_H_ |
OLD | NEW |