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

Side by Side Diff: cc/input/scrollbar_animation_controller.cc

Issue 2770293003: Feed ScrollableArea::showOverlayScrollbars into ScrollbarAnimationController. (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « cc/input/scrollbar_animation_controller.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/input/scrollbar_animation_controller.h" 5 #include "cc/input/scrollbar_animation_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 vertical_controller_->UpdateThumbThicknessScale(); 218 vertical_controller_->UpdateThumbThicknessScale();
219 horizontal_controller_->UpdateThumbThicknessScale(); 219 horizontal_controller_->UpdateThumbThicknessScale();
220 } 220 }
221 } 221 }
222 222
223 void ScrollbarAnimationController::WillUpdateScroll() { 223 void ScrollbarAnimationController::WillUpdateScroll() {
224 if (show_scrollbars_on_scroll_gesture_) 224 if (show_scrollbars_on_scroll_gesture_)
225 DidScrollUpdate(); 225 DidScrollUpdate();
226 } 226 }
227 227
228 void ScrollbarAnimationController::DidRequestShowFromMainThread() {
229 DidScrollUpdate();
230 }
231
228 void ScrollbarAnimationController::DidResize() { 232 void ScrollbarAnimationController::DidResize() {
229 StopAnimation(); 233 StopAnimation();
230 Show(); 234 Show();
231 235
232 // As an optimization, we avoid spamming fade delay tasks during active fast 236 // As an optimization, we avoid spamming fade delay tasks during active fast
233 // scrolls. 237 // scrolls.
234 if (!currently_scrolling_) { 238 if (!currently_scrolling_) {
235 PostDelayedFadeOut(true); 239 PostDelayedFadeOut(true);
236 } else { 240 } else {
237 show_in_fast_scroll_ = true; 241 show_in_fast_scroll_ = true;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 if (opacity_ != opacity) 393 if (opacity_ != opacity)
390 client_->SetNeedsRedrawForScrollbarAnimation(); 394 client_->SetNeedsRedrawForScrollbarAnimation();
391 395
392 opacity_ = opacity; 396 opacity_ = opacity;
393 397
394 if (previouslyVisible != currentlyVisible) 398 if (previouslyVisible != currentlyVisible)
395 client_->DidChangeScrollbarVisibility(); 399 client_->DidChangeScrollbarVisibility();
396 } 400 }
397 401
398 } // namespace cc 402 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/scrollbar_animation_controller.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698