OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_CONTROLLER_H_ | 5 #ifndef UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_ |
6 #define UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_ | 6 #define UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 namespace test { | 28 namespace test { |
29 class TooltipControllerTestHelper; | 29 class TooltipControllerTestHelper; |
30 } // namespace test | 30 } // namespace test |
31 | 31 |
32 // TooltipController provides tooltip functionality for aura. | 32 // TooltipController provides tooltip functionality for aura. |
33 class VIEWS_EXPORT TooltipController : public aura::client::TooltipClient, | 33 class VIEWS_EXPORT TooltipController : public aura::client::TooltipClient, |
34 public ui::EventHandler, | 34 public ui::EventHandler, |
35 public aura::WindowObserver { | 35 public aura::WindowObserver { |
36 public: | 36 public: |
37 explicit TooltipController(scoped_ptr<Tooltip> tooltip); | 37 explicit TooltipController(scoped_ptr<Tooltip> tooltip); |
38 virtual ~TooltipController(); | 38 ~TooltipController() override; |
39 | 39 |
40 // Overridden from aura::client::TooltipClient. | 40 // Overridden from aura::client::TooltipClient. |
41 virtual void UpdateTooltip(aura::Window* target) override; | 41 void UpdateTooltip(aura::Window* target) override; |
42 virtual void SetTooltipShownTimeout(aura::Window* target, | 42 void SetTooltipShownTimeout(aura::Window* target, int timeout_in_ms) override; |
43 int timeout_in_ms) override; | 43 void SetTooltipsEnabled(bool enable) override; |
44 virtual void SetTooltipsEnabled(bool enable) override; | |
45 | 44 |
46 // Overridden from ui::EventHandler. | 45 // Overridden from ui::EventHandler. |
47 virtual void OnKeyEvent(ui::KeyEvent* event) override; | 46 void OnKeyEvent(ui::KeyEvent* event) override; |
48 virtual void OnMouseEvent(ui::MouseEvent* event) override; | 47 void OnMouseEvent(ui::MouseEvent* event) override; |
49 virtual void OnTouchEvent(ui::TouchEvent* event) override; | 48 void OnTouchEvent(ui::TouchEvent* event) override; |
50 virtual void OnCancelMode(ui::CancelModeEvent* event) override; | 49 void OnCancelMode(ui::CancelModeEvent* event) override; |
51 | 50 |
52 // Overridden from aura::WindowObserver. | 51 // Overridden from aura::WindowObserver. |
53 virtual void OnWindowDestroyed(aura::Window* window) override; | 52 void OnWindowDestroyed(aura::Window* window) override; |
54 | 53 |
55 const gfx::Point& mouse_location() const { return curr_mouse_loc_; } | 54 const gfx::Point& mouse_location() const { return curr_mouse_loc_; } |
56 | 55 |
57 private: | 56 private: |
58 friend class test::TooltipControllerTestHelper; | 57 friend class test::TooltipControllerTestHelper; |
59 | 58 |
60 void TooltipTimerFired(); | 59 void TooltipTimerFired(); |
61 void TooltipShownTimerFired(); | 60 void TooltipShownTimerFired(); |
62 | 61 |
63 // Updates the tooltip if required (if there is any change in the tooltip | 62 // Updates the tooltip if required (if there is any change in the tooltip |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 101 |
103 std::map<aura::Window*, int> tooltip_shown_timeout_map_; | 102 std::map<aura::Window*, int> tooltip_shown_timeout_map_; |
104 | 103 |
105 DISALLOW_COPY_AND_ASSIGN(TooltipController); | 104 DISALLOW_COPY_AND_ASSIGN(TooltipController); |
106 }; | 105 }; |
107 | 106 |
108 } // namespace corewm | 107 } // namespace corewm |
109 } // namespace views | 108 } // namespace views |
110 | 109 |
111 #endif // UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_ | 110 #endif // UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_ |
OLD | NEW |