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

Unified Diff: cc/input/scrollbar_animation_controller_thinning.h

Issue 2442573002: Implement fade-out animation for Aura overlay scrollbars (CC only). (Closed)
Patch Set: Address aelias@'s feedback Created 4 years, 2 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_thinning.h
diff --git a/cc/input/scrollbar_animation_controller_thinning.h b/cc/input/scrollbar_animation_controller_thinning.h
index d1d4ee0bac8539ade7052c282b7914c4e863fb0e..e3b2ab8ede10ee87bd50757474f89123620b0040 100644
--- a/cc/input/scrollbar_animation_controller_thinning.h
+++ b/cc/input/scrollbar_animation_controller_thinning.h
@@ -24,7 +24,8 @@ class CC_EXPORT ScrollbarAnimationControllerThinning
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
base::TimeDelta resize_delay_before_starting,
- base::TimeDelta duration);
+ base::TimeDelta fade_duration,
+ base::TimeDelta thinning_duration);
~ScrollbarAnimationControllerThinning() override;
@@ -47,34 +48,42 @@ class CC_EXPORT ScrollbarAnimationControllerThinning
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
base::TimeDelta resize_delay_before_starting,
- base::TimeDelta duration);
+ base::TimeDelta fade_duration,
+ base::TimeDelta thinning_duration);
void RunAnimationFrame(float progress) override;
+ const base::TimeDelta& Duration() override;
private:
- // Describes whether the current animation should INCREASE (darken / thicken)
- // a bar or DECREASE it (lighten / thin).
+ // Describes whether the current animation should INCREASE (thicken)
+ // a bar or DECREASE it (thin).
enum AnimationChange { NONE, INCREASE, DECREASE };
- float OpacityAtAnimationProgress(float progress);
- float ThumbThicknessScaleAtAnimationProgress(float progress);
+ enum AnimatingProperty { OPACITY, THICKNESS };
+ float ThumbThicknessScaleAt(float progress);
float AdjustScale(float new_value,
float current_value,
AnimationChange animation_change,
float min_value,
float max_value);
- void ApplyOpacityAndThumbThicknessScale(float opacity,
- float thumb_thickness_scale);
+ void ApplyOpacity(float opacity);
+ void ApplyThumbThicknessScale(float thumb_thickness_scale);
+ void SetCurrentAnimatingProperty(AnimatingProperty property);
+
+ float opacity_;
bool captured_;
bool mouse_is_over_scrollbar_;
bool mouse_is_near_scrollbar_;
// Are we narrowing or thickening the bars.
AnimationChange thickness_change_;
- // Are we darkening or lightening the bars.
- AnimationChange opacity_change_;
// How close should the mouse be to the scrollbar before we thicken it.
float mouse_move_distance_to_trigger_animation_;
+ base::TimeDelta fade_duration_;
+ base::TimeDelta thinning_duration_;
+
+ AnimatingProperty current_animating_property_;
+
DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning);
};
« no previous file with comments | « cc/input/scrollbar_animation_controller_linear_fade.cc ('k') | cc/input/scrollbar_animation_controller_thinning.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698