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 ASH_COMMON_SHELF_SHELF_TOOLTIP_MANAGER_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_TOOLTIP_MANAGER_H_ |
6 #define ASH_COMMON_SHELF_SHELF_TOOLTIP_MANAGER_H_ | 6 #define ASH_COMMON_SHELF_SHELF_TOOLTIP_MANAGER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/common/shelf/wm_shelf_observer.h" | 9 #include "ash/common/shelf/wm_shelf_observer.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void ShowTooltipWithDelay(views::View* view); | 51 void ShowTooltipWithDelay(views::View* view); |
52 | 52 |
53 // Set the timer delay in ms for testing. | 53 // Set the timer delay in ms for testing. |
54 void set_timer_delay_for_test(int timer_delay) { timer_delay_ = timer_delay; } | 54 void set_timer_delay_for_test(int timer_delay) { timer_delay_ = timer_delay; } |
55 | 55 |
56 protected: | 56 protected: |
57 // ui::EventHandler overrides: | 57 // ui::EventHandler overrides: |
58 void OnMouseEvent(ui::MouseEvent* event) override; | 58 void OnMouseEvent(ui::MouseEvent* event) override; |
59 | 59 |
60 // views::PointerWatcher overrides: | 60 // views::PointerWatcher overrides: |
61 void OnMousePressed(const ui::MouseEvent& event, | 61 void OnPointerEventObserved(const ui::PointerEvent& event, |
62 const gfx::Point& location_in_screen, | 62 const gfx::Point& location_in_screen, |
63 views::Widget* target) override; | 63 views::Widget* target) override; |
64 void OnTouchPressed(const ui::TouchEvent& event, | |
65 const gfx::Point& location_in_screen, | |
66 views::Widget* target) override; | |
67 | 64 |
68 // WmShelfObserver overrides: | 65 // WmShelfObserver overrides: |
69 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; | 66 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; |
70 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; | 67 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; |
71 | 68 |
72 private: | 69 private: |
73 class ShelfTooltipBubble; | 70 class ShelfTooltipBubble; |
74 friend class test::ShelfViewTest; | 71 friend class test::ShelfViewTest; |
75 friend class test::ShelfTooltipManagerTest; | 72 friend class test::ShelfTooltipManagerTest; |
76 | 73 |
77 // A helper function to check for shelf visibility and view validity. | 74 // A helper function to check for shelf visibility and view validity. |
78 bool ShouldShowTooltipForView(views::View* view); | 75 bool ShouldShowTooltipForView(views::View* view); |
79 | 76 |
80 int timer_delay_; | 77 int timer_delay_; |
81 base::OneShotTimer timer_; | 78 base::OneShotTimer timer_; |
82 | 79 |
83 ShelfView* shelf_view_; | 80 ShelfView* shelf_view_; |
84 views::BubbleDialogDelegateView* bubble_; | 81 views::BubbleDialogDelegateView* bubble_; |
85 | 82 |
86 base::WeakPtrFactory<ShelfTooltipManager> weak_factory_; | 83 base::WeakPtrFactory<ShelfTooltipManager> weak_factory_; |
87 | 84 |
88 DISALLOW_COPY_AND_ASSIGN(ShelfTooltipManager); | 85 DISALLOW_COPY_AND_ASSIGN(ShelfTooltipManager); |
89 }; | 86 }; |
90 | 87 |
91 } // namespace ash | 88 } // namespace ash |
92 | 89 |
93 #endif // ASH_COMMON_SHELF_SHELF_TOOLTIP_MANAGER_H_ | 90 #endif // ASH_COMMON_SHELF_SHELF_TOOLTIP_MANAGER_H_ |
OLD | NEW |