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

Unified Diff: cc/input/scrollbar_animation_controller.cc

Issue 2442573002: Implement fade-out animation for Aura overlay scrollbars (CC only). (Closed)
Patch Set: Few more fixes 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.cc
diff --git a/cc/input/scrollbar_animation_controller.cc b/cc/input/scrollbar_animation_controller.cc
index 45feb3ae2bfb0fa0e664b49d8531652de8dc0437..9fad17d4660c44bd7e158a34b902f3cd6bc26c81 100644
--- a/cc/input/scrollbar_animation_controller.cc
+++ b/cc/input/scrollbar_animation_controller.cc
@@ -18,9 +18,9 @@ ScrollbarAnimationController::ScrollbarAnimationController(
base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration)
: client_(client),
+ duration_(duration),
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),
@@ -57,10 +57,11 @@ 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.
+ // TODO(bokan): When do we get ScrollUpdates without a ScrollBegin? This may
aelias_OOO_until_Jul13 2016/10/20 23:40:51 Any kind of main-thread scroll (JS, history or ges
bokan 2016/10/21 00:32:30 Got it, thanks. Removed TODO and added a test.
+ // be unsupported behavior at this point.
if (!currently_scrolling_)
PostDelayedAnimationTask(on_resize);
else
@@ -94,6 +95,7 @@ void ScrollbarAnimationController::StartAnimation() {
}
void ScrollbarAnimationController::StopAnimation() {
+ delayed_scrollbar_fade_.Cancel();
is_animating_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698