Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: cc/input/scrollbar_animation_controller.h

Issue 2816923002: change overlay scrollbar hover show to hover fade in (Closed)
Patch Set: merge fade-in and fade-out to same code method Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..eec80c554b0186898f422df8ff3e6f78865a6f13 100644
--- a/cc/input/scrollbar_animation_controller.h
+++ b/cc/input/scrollbar_animation_controller.h
@@ -53,9 +53,10 @@ class CC_EXPORT ScrollbarAnimationController {
CreateScrollbarAnimationControllerAuraOverlay(
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_in_duration,
base::TimeDelta fade_out_duration,
base::TimeDelta thinning_duration);
@@ -93,9 +94,12 @@ 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,
@@ -104,9 +108,10 @@ class CC_EXPORT ScrollbarAnimationController {
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_in_duration,
base::TimeDelta fade_out_duration,
base::TimeDelta thinning_duration);
@@ -124,8 +129,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 +142,27 @@ 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_in_duration_;
+ base::TimeDelta fade_out_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_;
« no previous file with comments | « no previous file | cc/input/scrollbar_animation_controller.cc » ('j') | cc/input/scrollbar_animation_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698