OLD | NEW |
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 horizontal_controller_->UpdateThumbThicknessScale(); | 223 horizontal_controller_->UpdateThumbThicknessScale(); |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 void ScrollbarAnimationController::WillUpdateScroll() { | 227 void ScrollbarAnimationController::WillUpdateScroll() { |
228 if (show_scrollbars_on_scroll_gesture_) | 228 if (show_scrollbars_on_scroll_gesture_) |
229 DidScrollUpdate(); | 229 DidScrollUpdate(); |
230 } | 230 } |
231 | 231 |
232 void ScrollbarAnimationController::DidRequestShowFromMainThread() { | 232 void ScrollbarAnimationController::DidRequestShowFromMainThread() { |
233 // TODO(skobes): Call DidScrollUpdate here (suppressed for crbug.com/706927). | 233 DidScrollUpdate(); |
234 } | 234 } |
235 | 235 |
236 void ScrollbarAnimationController::DidResize() { | 236 void ScrollbarAnimationController::DidResize() { |
237 StopAnimation(); | 237 StopAnimation(); |
238 Show(); | 238 Show(); |
239 | 239 |
240 // As an optimization, we avoid spamming fade delay tasks during active fast | 240 // As an optimization, we avoid spamming fade delay tasks during active fast |
241 // scrolls. | 241 // scrolls. |
242 if (!currently_scrolling_) { | 242 if (!currently_scrolling_) { |
243 PostDelayedAnimation(FADE_OUT, true); | 243 PostDelayedAnimation(FADE_OUT, true); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 if (opacity_ != opacity) | 381 if (opacity_ != opacity) |
382 client_->SetNeedsRedrawForScrollbarAnimation(); | 382 client_->SetNeedsRedrawForScrollbarAnimation(); |
383 | 383 |
384 opacity_ = opacity; | 384 opacity_ = opacity; |
385 | 385 |
386 if (previouslyVisible != currentlyVisible) | 386 if (previouslyVisible != currentlyVisible) |
387 client_->DidChangeScrollbarVisibility(); | 387 client_->DidChangeScrollbarVisibility(); |
388 } | 388 } |
389 | 389 |
390 } // namespace cc | 390 } // namespace cc |
OLD | NEW |