| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/animation/scrollbar_animation_controller_thinning.h" | 5 #include "cc/animation/scrollbar_animation_controller_thinning.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "cc/layers/layer_impl.h" | 8 #include "cc/layers/layer_impl.h" |
| 9 #include "cc/layers/scrollbar_layer_impl_base.h" | 9 #include "cc/layers/scrollbar_layer_impl_base.h" |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 float opacity, float thumb_thickness_scale) { | 138 float opacity, float thumb_thickness_scale) { |
| 139 if (!scroll_layer_->scrollbars()) | 139 if (!scroll_layer_->scrollbars()) |
| 140 return; | 140 return; |
| 141 | 141 |
| 142 LayerImpl::ScrollbarSet* scrollbars = scroll_layer_->scrollbars(); | 142 LayerImpl::ScrollbarSet* scrollbars = scroll_layer_->scrollbars(); |
| 143 for (LayerImpl::ScrollbarSet::iterator it = scrollbars->begin(); | 143 for (LayerImpl::ScrollbarSet::iterator it = scrollbars->begin(); |
| 144 it != scrollbars->end(); | 144 it != scrollbars->end(); |
| 145 ++it) { | 145 ++it) { |
| 146 ScrollbarLayerImplBase* scrollbar = *it; | 146 ScrollbarLayerImplBase* scrollbar = *it; |
| 147 if (scrollbar->is_overlay_scrollbar()) { | 147 if (scrollbar->is_overlay_scrollbar()) { |
| 148 scrollbar->SetOpacity( | 148 float effectiveOpacity = |
| 149 AdjustScale(opacity, scrollbar->opacity(), opacity_change_)); | 149 scrollbar->can_scroll_orientation() |
| 150 ? AdjustScale(opacity, scrollbar->opacity(), opacity_change_) |
| 151 : 0; |
| 152 |
| 153 scrollbar->SetOpacity(effectiveOpacity); |
| 150 scrollbar->SetThumbThicknessScaleFactor( | 154 scrollbar->SetThumbThicknessScaleFactor( |
| 151 AdjustScale(thumb_thickness_scale, | 155 AdjustScale(thumb_thickness_scale, |
| 152 scrollbar->thumb_thickness_scale_factor(), | 156 scrollbar->thumb_thickness_scale_factor(), |
| 153 thickness_change_)); | 157 thickness_change_)); |
| 154 } | 158 } |
| 155 } | 159 } |
| 156 } | 160 } |
| 157 | 161 |
| 158 } // namespace cc | 162 } // namespace cc |
| OLD | NEW |