OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ | 5 #ifndef CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ |
6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ | 6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 base::TimeDelta fade_out_resize_delay, | 58 base::TimeDelta fade_out_resize_delay, |
59 base::TimeDelta fade_out_duration, | 59 base::TimeDelta fade_out_duration, |
60 base::TimeDelta thinning_duration); | 60 base::TimeDelta thinning_duration); |
61 | 61 |
62 ~ScrollbarAnimationController(); | 62 ~ScrollbarAnimationController(); |
63 | 63 |
64 bool ScrollbarsHidden() const; | 64 bool ScrollbarsHidden() const; |
65 | 65 |
66 bool Animate(base::TimeTicks now); | 66 bool Animate(base::TimeTicks now); |
67 | 67 |
| 68 // WillUpdateScroll expects to be called even if the scroll position won't |
| 69 // change as a result of the scroll. Only effect Aura Overlay Scrollbar. |
| 70 void WillUpdateScroll(); |
| 71 |
| 72 // DidScrollUpdate expects to be called only if the scroll position change. |
| 73 // Effect both Android and Aura Overlay Scrollbar. |
| 74 void DidScrollUpdate(); |
| 75 |
| 76 // DidResize expects to be called when clip layer size changed or scroll layer |
| 77 // size changed. |
| 78 void DidResize(); |
| 79 |
68 void DidScrollBegin(); | 80 void DidScrollBegin(); |
69 void DidScrollUpdate(bool on_resize); | |
70 void DidScrollEnd(); | 81 void DidScrollEnd(); |
71 | 82 |
72 void DidMouseDown(); | 83 void DidMouseDown(); |
73 void DidMouseUp(); | 84 void DidMouseUp(); |
74 void DidMouseLeave(); | 85 void DidMouseLeave(); |
75 void DidMouseMoveNear(ScrollbarOrientation, float); | 86 void DidMouseMoveNear(ScrollbarOrientation, float); |
76 | 87 |
77 bool MouseIsOverScrollbar(ScrollbarOrientation orientation) const; | 88 bool MouseIsOverScrollbar(ScrollbarOrientation orientation) const; |
78 bool MouseIsNearScrollbar(ScrollbarOrientation orientation) const; | 89 bool MouseIsNearScrollbar(ScrollbarOrientation orientation) const; |
79 bool MouseIsNearAnyScrollbar() const; | 90 bool MouseIsNearAnyScrollbar() const; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 base::TimeDelta show_delay_; | 139 base::TimeDelta show_delay_; |
129 base::TimeDelta fade_out_delay_; | 140 base::TimeDelta fade_out_delay_; |
130 base::TimeDelta fade_out_resize_delay_; | 141 base::TimeDelta fade_out_resize_delay_; |
131 | 142 |
132 bool need_trigger_scrollbar_show_; | 143 bool need_trigger_scrollbar_show_; |
133 | 144 |
134 bool is_animating_; | 145 bool is_animating_; |
135 | 146 |
136 const int scroll_layer_id_; | 147 const int scroll_layer_id_; |
137 bool currently_scrolling_; | 148 bool currently_scrolling_; |
138 bool scroll_gesture_has_scrolled_; | 149 bool show_in_fast_scroll_; |
139 | 150 |
140 base::CancelableClosure delayed_scrollbar_show_; | 151 base::CancelableClosure delayed_scrollbar_show_; |
141 base::CancelableClosure delayed_scrollbar_fade_out_; | 152 base::CancelableClosure delayed_scrollbar_fade_out_; |
142 | 153 |
143 float opacity_; | 154 float opacity_; |
144 base::TimeDelta fade_out_duration_; | 155 base::TimeDelta fade_out_duration_; |
145 | 156 |
| 157 const bool show_scrollbars_on_scroll_gesture_; |
146 const bool need_thinning_animation_; | 158 const bool need_thinning_animation_; |
147 std::unique_ptr<SingleScrollbarAnimationControllerThinning> | 159 std::unique_ptr<SingleScrollbarAnimationControllerThinning> |
148 vertical_controller_; | 160 vertical_controller_; |
149 std::unique_ptr<SingleScrollbarAnimationControllerThinning> | 161 std::unique_ptr<SingleScrollbarAnimationControllerThinning> |
150 horizontal_controller_; | 162 horizontal_controller_; |
151 | 163 |
152 base::WeakPtrFactory<ScrollbarAnimationController> weak_factory_; | 164 base::WeakPtrFactory<ScrollbarAnimationController> weak_factory_; |
153 }; | 165 }; |
154 | 166 |
155 } // namespace cc | 167 } // namespace cc |
156 | 168 |
157 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ | 169 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ |
OLD | NEW |