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

Unified Diff: cc/input/scrollbar_animation_controller.cc

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
« no previous file with comments | « cc/input/scrollbar_animation_controller.h ('k') | cc/input/scrollbar_animation_controller_linear_fade.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/scrollbar_animation_controller.cc
diff --git a/cc/input/scrollbar_animation_controller.cc b/cc/input/scrollbar_animation_controller.cc
index 45feb3ae2bfb0fa0e664b49d8531652de8dc0437..086f63e30f939ef11c662d500b9bf51c2f3899a0 100644
--- a/cc/input/scrollbar_animation_controller.cc
+++ b/cc/input/scrollbar_animation_controller.cc
@@ -15,12 +15,10 @@ ScrollbarAnimationController::ScrollbarAnimationController(
int scroll_layer_id,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
- base::TimeDelta resize_delay_before_starting,
- base::TimeDelta duration)
+ base::TimeDelta resize_delay_before_starting)
: client_(client),
delay_before_starting_(delay_before_starting),
resize_delay_before_starting_(resize_delay_before_starting),
- duration_(duration),
is_animating_(false),
scroll_layer_id_(scroll_layer_id),
currently_scrolling_(false),
@@ -47,7 +45,7 @@ bool ScrollbarAnimationController::Animate(base::TimeTicks now) {
float ScrollbarAnimationController::AnimationProgressAtTime(
base::TimeTicks now) {
base::TimeDelta delta = now - last_awaken_time_;
- float progress = delta.InSecondsF() / duration_.InSecondsF();
+ float progress = delta.InSecondsF() / Duration().InSecondsF();
return std::max(std::min(progress, 1.f), 0.f);
}
@@ -57,7 +55,6 @@ void ScrollbarAnimationController::DidScrollBegin() {
void ScrollbarAnimationController::DidScrollUpdate(bool on_resize) {
StopAnimation();
- delayed_scrollbar_fade_.Cancel();
// As an optimization, we avoid spamming fade delay tasks during active fast
// scrolls. But if we're not within one, we need to post every scroll update.
@@ -94,6 +91,7 @@ void ScrollbarAnimationController::StartAnimation() {
}
void ScrollbarAnimationController::StopAnimation() {
+ delayed_scrollbar_fade_.Cancel();
is_animating_ = false;
}
« no previous file with comments | « cc/input/scrollbar_animation_controller.h ('k') | cc/input/scrollbar_animation_controller_linear_fade.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698