Index: cc/animation/scrollbar_animation_controller_linear_fade.cc |
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.cc b/cc/animation/scrollbar_animation_controller_linear_fade.cc |
index 863959b84c27691f9afe1cca9628b399fc3b04e9..049b87396a51ec42d4f5fd3c8515996a3b428f2e 100644 |
--- a/cc/animation/scrollbar_animation_controller_linear_fade.cc |
+++ b/cc/animation/scrollbar_animation_controller_linear_fade.cc |
@@ -112,15 +112,17 @@ float ScrollbarAnimationControllerLinearFade::OpacityAtTime( |
void ScrollbarAnimationControllerLinearFade::ApplyOpacityToScrollbars( |
float opacity) { |
- ScrollbarLayerImplBase* horizontal_scrollbar = |
- scroll_layer_->horizontal_scrollbar_layer(); |
- if (horizontal_scrollbar) |
- horizontal_scrollbar->SetOpacity(opacity); |
- |
- ScrollbarLayerImplBase* vertical_scrollbar = |
- scroll_layer_->vertical_scrollbar_layer(); |
- if (vertical_scrollbar) |
- vertical_scrollbar->SetOpacity(opacity); |
+ 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(opacity); |
+ } |
} |
} // namespace cc |