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

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: Rebase to r248052. Created 6 years, 11 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 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_));
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698