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

Unified Diff: cc/animation/scrollbar_animation_controller_thinning.cc

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Backup 2013.10.29 Created 7 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/animation/scrollbar_animation_controller_thinning.cc
diff --git a/cc/animation/scrollbar_animation_controller_thinning.cc b/cc/animation/scrollbar_animation_controller_thinning.cc
index ce196fbf955e61320af9a5669f011ced1437f185..0eb972a82208fcd941b6628b48ed7e87722556ad 100644
--- a/cc/animation/scrollbar_animation_controller_thinning.cc
+++ b/cc/animation/scrollbar_animation_controller_thinning.cc
@@ -138,19 +138,18 @@ ScrollbarAnimationControllerThinning::ThumbThicknessScaleAtAnimationProgress(
void ScrollbarAnimationControllerThinning::ApplyOpacityAndThumbThicknessScale(
float opacity, float thumb_thickness_scale) {
- ScrollbarLayerImplBase* horizontal_scrollbar =
- scroll_layer_->horizontal_scrollbar_layer();
- if (horizontal_scrollbar) {
- horizontal_scrollbar->SetOpacity(opacity);
- horizontal_scrollbar->set_thumb_thickness_scale_factor(
- thumb_thickness_scale);
- }
-
- ScrollbarLayerImplBase* vertical_scrollbar =
- scroll_layer_->vertical_scrollbar_layer();
- if (vertical_scrollbar) {
- vertical_scrollbar->SetOpacity(opacity);
- vertical_scrollbar->set_thumb_thickness_scale_factor(thumb_thickness_scale);
+ if (!scroll_layer_->scrollbars())
+ return;
+
+ LayerImpl::ScrollbarSet* scrollbars = scroll_layer_->scrollbars();
+ for (LayerImpl::ScrollbarSet::iterator it = scrollbars->begin();
+ it != scrollbars->end();
+ ++it) {
+ ScrollbarLayerImplBase* scrollbar = *it;
+ if (scrollbar->opacity_can_animate()) {
+ scrollbar->SetOpacity(opacity);
+ scrollbar->set_thumb_thickness_scale_factor(thumb_thickness_scale);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698