| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/views/corewm/tooltip.h" | 11 #include "ui/views/corewm/tooltip.h" |
| 12 #include "ui/views/widget/widget_observer.h" | 12 #include "ui/views/widget/widget_observer.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class RenderText; |
| 15 class Size; | 16 class Size; |
| 16 } // namespace gfx | 17 } // namespace gfx |
| 17 | 18 |
| 18 namespace views { | 19 namespace views { |
| 19 | 20 |
| 20 class Widget; | 21 class Widget; |
| 21 | 22 |
| 22 namespace corewm { | 23 namespace corewm { |
| 24 namespace test { |
| 25 class TooltipAuraTestApi; |
| 26 } |
| 23 | 27 |
| 24 // Implementation of Tooltip that shows the tooltip using a Widget and Label. | 28 // Implementation of Tooltip that shows the tooltip using a Widget and Label. |
| 25 class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver { | 29 class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver { |
| 26 public: | 30 public: |
| 27 TooltipAura(); | 31 TooltipAura(); |
| 28 ~TooltipAura() override; | 32 ~TooltipAura() override; |
| 29 | 33 |
| 30 private: | 34 private: |
| 31 class TooltipView; | 35 class TooltipView; |
| 32 | 36 |
| 37 friend class test::TooltipAuraTestApi; |
| 38 gfx::RenderText* GetRenderTextForTest(); |
| 39 |
| 33 // Adjusts the bounds given by the arguments to fit inside the desktop | 40 // Adjusts the bounds given by the arguments to fit inside the desktop |
| 34 // and applies the adjusted bounds to the label_. | 41 // and applies the adjusted bounds to the label_. |
| 35 void SetTooltipBounds(const gfx::Point& mouse_pos, | 42 void SetTooltipBounds(const gfx::Point& mouse_pos, |
| 36 const gfx::Size& tooltip_size); | 43 const gfx::Size& tooltip_size); |
| 37 | 44 |
| 38 // Destroys |widget_|. | 45 // Destroys |widget_|. |
| 39 void DestroyWidget(); | 46 void DestroyWidget(); |
| 40 | 47 |
| 41 // Tooltip: | 48 // Tooltip: |
| 42 int GetMaxWidth(const gfx::Point& location) const override; | 49 int GetMaxWidth(const gfx::Point& location) const override; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 // showing. | 67 // showing. |
| 61 aura::Window* tooltip_window_; | 68 aura::Window* tooltip_window_; |
| 62 | 69 |
| 63 DISALLOW_COPY_AND_ASSIGN(TooltipAura); | 70 DISALLOW_COPY_AND_ASSIGN(TooltipAura); |
| 64 }; | 71 }; |
| 65 | 72 |
| 66 } // namespace corewm | 73 } // namespace corewm |
| 67 } // namespace views | 74 } // namespace views |
| 68 | 75 |
| 69 #endif // UI_VIEWS_COREWM_TOOLTIP_AURA_H_ | 76 #endif // UI_VIEWS_COREWM_TOOLTIP_AURA_H_ |
| OLD | NEW |