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 3de75989d0e47771f64c59f5bf6d4ac1b7a52564..18a495924d9162081ba96d999d686e921ce0bb17 100644 |
--- a/cc/animation/scrollbar_animation_controller_thinning.cc |
+++ b/cc/animation/scrollbar_animation_controller_thinning.cc |
@@ -180,28 +180,22 @@ float ScrollbarAnimationControllerThinning::AdjustScale( |
void ScrollbarAnimationControllerThinning::ApplyOpacityAndThumbThicknessScale( |
float opacity, float thumb_thickness_scale) { |
- ScrollbarLayerImplBase* horizontal_scrollbar = |
- scroll_layer_->horizontal_scrollbar_layer(); |
- if (horizontal_scrollbar) { |
- horizontal_scrollbar->SetOpacity( |
- AdjustScale(opacity, horizontal_scrollbar->opacity(), opacity_change_)); |
- horizontal_scrollbar->SetThumbThicknessScaleFactor( |
- AdjustScale( |
- thumb_thickness_scale, |
- horizontal_scrollbar->thumb_thickness_scale_factor(), |
- thickness_change_)); |
- } |
- |
- ScrollbarLayerImplBase* vertical_scrollbar = |
- scroll_layer_->vertical_scrollbar_layer(); |
- if (vertical_scrollbar) { |
- vertical_scrollbar->SetOpacity( |
- AdjustScale(opacity, vertical_scrollbar->opacity(), opacity_change_)); |
- vertical_scrollbar->SetThumbThicknessScaleFactor( |
- AdjustScale( |
- thumb_thickness_scale, |
- vertical_scrollbar->thumb_thickness_scale_factor(), |
- thickness_change_)); |
+ 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->is_overlay_scrollbar()) { |
+ scrollbar->SetOpacity( |
+ AdjustScale(opacity, scrollbar->opacity(), opacity_change_)); |
+ scrollbar->SetThumbThicknessScaleFactor( |
+ AdjustScale(thumb_thickness_scale, |
+ scrollbar->thumb_thickness_scale_factor(), |
+ thickness_change_)); |
+ } |
} |
} |