Chromium Code Reviews| Index: cc/input/scrollbar_animation_controller.h |
| diff --git a/cc/input/scrollbar_animation_controller.h b/cc/input/scrollbar_animation_controller.h |
| index d481eae15fbc6467ab1408c5b1252359e024c320..cd0e2f164472e82ebd3fee4e0fe2c0e242fa3ae8 100644 |
| --- a/cc/input/scrollbar_animation_controller.h |
| +++ b/cc/input/scrollbar_animation_controller.h |
| @@ -45,7 +45,7 @@ class CC_EXPORT ScrollbarAnimationController { |
| ScrollbarAnimationControllerClient* client, |
| base::TimeDelta fade_out_delay, |
| base::TimeDelta fade_out_resize_delay, |
| - base::TimeDelta fade_out_duration); |
| + base::TimeDelta fade_duration); |
| // ScrollbarAnimationController for Desktop Overlay Scrollbar. It has show & |
| // fade out animation and thinning animation. |
| @@ -53,10 +53,10 @@ class CC_EXPORT ScrollbarAnimationController { |
| CreateScrollbarAnimationControllerAuraOverlay( |
| int scroll_layer_id, |
| ScrollbarAnimationControllerClient* client, |
| - base::TimeDelta show_delay, |
| + base::TimeDelta fade_in_delay, |
|
Evan Stade
2017/04/20 14:33:45
I had envisioned you combining these as well, but
chaopeng
2017/04/20 14:50:38
Now we have fade_in_delay, fade_out_delay and fade
|
| base::TimeDelta fade_out_delay, |
| base::TimeDelta fade_out_resize_delay, |
| - base::TimeDelta fade_out_duration, |
| + base::TimeDelta fade_duration, |
| base::TimeDelta thinning_duration); |
| ~ScrollbarAnimationController(); |
| @@ -93,21 +93,24 @@ class CC_EXPORT ScrollbarAnimationController { |
| bool MouseIsNearScrollbar(ScrollbarOrientation orientation) const; |
| bool MouseIsNearAnyScrollbar() const; |
| - static constexpr float kMouseMoveDistanceToTriggerShow = 30.0f; |
| + static constexpr float kMouseMoveDistanceToTriggerFadeIn = 30.0f; |
| private: |
| + // Describes whether the current animation should FadeIn or FadeOut. |
| + enum AnimationChange { NONE, FADE_IN, FADE_OUT }; |
| + |
| ScrollbarAnimationController(int scroll_layer_id, |
| ScrollbarAnimationControllerClient* client, |
| base::TimeDelta fade_out_delay, |
| base::TimeDelta fade_out_resize_delay, |
| - base::TimeDelta fade_out_duration); |
| + base::TimeDelta fade_duration); |
| ScrollbarAnimationController(int scroll_layer_id, |
| ScrollbarAnimationControllerClient* client, |
| - base::TimeDelta show_delay, |
| + base::TimeDelta fade_in_delay, |
| base::TimeDelta fade_out_delay, |
| base::TimeDelta fade_out_resize_delay, |
| - base::TimeDelta fade_out_duration, |
| + base::TimeDelta fade_duration, |
| base::TimeDelta thinning_duration); |
| ScrollbarSet Scrollbars() const; |
| @@ -124,8 +127,7 @@ class CC_EXPORT ScrollbarAnimationController { |
| void Show(); |
| - void PostDelayedShow(); |
| - void PostDelayedFadeOut(bool on_resize); |
| + void PostDelayedAnimation(AnimationChange animation_change, bool on_resize); |
| bool Captured() const; |
| @@ -138,25 +140,26 @@ class CC_EXPORT ScrollbarAnimationController { |
| base::TimeTicks last_awaken_time_; |
| - // show_delay_ is only for the case where the mouse hovers near the screen |
| + // fade_in_delay_ is only for the case where the mouse hovers near the screen |
| // edge. |
| - base::TimeDelta show_delay_; |
| + base::TimeDelta fade_in_delay_; |
| base::TimeDelta fade_out_delay_; |
| base::TimeDelta fade_out_resize_delay_; |
| + base::TimeDelta fade_duration_; |
| + |
| bool need_trigger_scrollbar_show_; |
| bool is_animating_; |
| + AnimationChange animation_change_; |
| const int scroll_layer_id_; |
| bool currently_scrolling_; |
| bool show_in_fast_scroll_; |
| - base::CancelableClosure delayed_scrollbar_show_; |
| - base::CancelableClosure delayed_scrollbar_fade_out_; |
| + base::CancelableClosure delayed_scrollbar_animation_; |
| float opacity_; |
| - base::TimeDelta fade_out_duration_; |
| const bool show_scrollbars_on_scroll_gesture_; |
| const bool need_thinning_animation_; |