| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COREWM_TOOLTIP_AURA_H_ | 5 #ifndef UI_VIEWS_COREWM_TOOLTIP_AURA_H_ |
| 6 #define UI_VIEWS_COREWM_TOOLTIP_AURA_H_ | 6 #define UI_VIEWS_COREWM_TOOLTIP_AURA_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/gfx/screen_type_delegate.h" | |
| 11 #include "ui/views/corewm/tooltip.h" | 10 #include "ui/views/corewm/tooltip.h" |
| 12 #include "ui/views/widget/widget_observer.h" | 11 #include "ui/views/widget/widget_observer.h" |
| 13 | 12 |
| 14 namespace gfx { | 13 namespace gfx { |
| 15 class FontList; | 14 class FontList; |
| 16 class Size; | 15 class Size; |
| 17 } // namespace gfx | 16 } // namespace gfx |
| 18 | 17 |
| 19 namespace views { | 18 namespace views { |
| 20 | 19 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 33 | 32 |
| 34 // Adjusts the bounds given by the arguments to fit inside the desktop | 33 // Adjusts the bounds given by the arguments to fit inside the desktop |
| 35 // and applies the adjusted bounds to the label_. | 34 // and applies the adjusted bounds to the label_. |
| 36 void SetTooltipBounds(const gfx::Point& mouse_pos, | 35 void SetTooltipBounds(const gfx::Point& mouse_pos, |
| 37 const gfx::Size& tooltip_size); | 36 const gfx::Size& tooltip_size); |
| 38 | 37 |
| 39 // Destroys |widget_|. | 38 // Destroys |widget_|. |
| 40 void DestroyWidget(); | 39 void DestroyWidget(); |
| 41 | 40 |
| 42 // Tooltip: | 41 // Tooltip: |
| 43 int GetMaxWidth(const gfx::Point& location, | 42 int GetMaxWidth(const gfx::Point& location) const override; |
| 44 aura::Window* context) const override; | |
| 45 void SetText(aura::Window* window, | 43 void SetText(aura::Window* window, |
| 46 const base::string16& tooltip_text, | 44 const base::string16& tooltip_text, |
| 47 const gfx::Point& location) override; | 45 const gfx::Point& location) override; |
| 48 void Show() override; | 46 void Show() override; |
| 49 void Hide() override; | 47 void Hide() override; |
| 50 bool IsVisible() override; | 48 bool IsVisible() override; |
| 51 | 49 |
| 52 // WidgetObserver: | 50 // WidgetObserver: |
| 53 void OnWidgetDestroying(Widget* widget) override; | 51 void OnWidgetDestroying(Widget* widget) override; |
| 54 | 52 |
| 55 // The view showing the tooltip. | 53 // The view showing the tooltip. |
| 56 scoped_ptr<TooltipView> tooltip_view_; | 54 scoped_ptr<TooltipView> tooltip_view_; |
| 57 | 55 |
| 58 // The widget containing the tooltip. May be NULL. | 56 // The widget containing the tooltip. May be NULL. |
| 59 Widget* widget_; | 57 Widget* widget_; |
| 60 | 58 |
| 61 // The window we're showing the tooltip for. Never NULL and valid while | 59 // The window we're showing the tooltip for. Never NULL and valid while |
| 62 // showing. | 60 // showing. |
| 63 aura::Window* tooltip_window_; | 61 aura::Window* tooltip_window_; |
| 64 | 62 |
| 65 DISALLOW_COPY_AND_ASSIGN(TooltipAura); | 63 DISALLOW_COPY_AND_ASSIGN(TooltipAura); |
| 66 }; | 64 }; |
| 67 | 65 |
| 68 } // namespace corewm | 66 } // namespace corewm |
| 69 } // namespace views | 67 } // namespace views |
| 70 | 68 |
| 71 #endif // UI_VIEWS_COREWM_TOOLTIP_AURA_H_ | 69 #endif // UI_VIEWS_COREWM_TOOLTIP_AURA_H_ |
| OLD | NEW |