Index: cc/layers/layer_impl.cc |
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc |
index 29bdfe778fdf522fc9a3a8f97d74ef4adb90b71c..93852188dc491646c574d482067287d684ca4995 100644 |
--- a/cc/layers/layer_impl.cc |
+++ b/cc/layers/layer_impl.cc |
@@ -61,6 +61,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id) |
draws_content_(false), |
hide_layer_and_subtree_(false), |
force_render_surface_(false), |
+ delay_scrollbar_animation_(false), |
transform_is_invertible_(true), |
is_container_for_fixed_position_layers_(false), |
background_color_(0), |
@@ -782,7 +783,9 @@ void LayerImpl::SetBounds(const gfx::Size& bounds) { |
bounds_ = bounds; |
+ delay_scrollbar_animation_ = true; |
ScrollbarParametersDidChange(); |
+ delay_scrollbar_animation_ = false; |
if (masks_to_bounds()) |
NoteLayerPropertyChangedForSubtree(); |
else |
@@ -1310,8 +1313,17 @@ void LayerImpl::SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer, |
((layer_tree_impl()->total_page_scale_factor() > |
layer_tree_impl()->min_page_scale_factor()) || |
!layer_tree_impl()->settings().use_pinch_zoom_scrollbars); |
- if (is_animatable_scrollbar) |
+ if (is_animatable_scrollbar) { |
+ base::TimeDelta delay; |
+ if (delay_scrollbar_animation_) |
+ delay = base::TimeDelta::FromMilliseconds( |
+ layer_tree_impl()->settings().scrollbar_fade_extra_delay_ms); |
+ else |
+ delay = base::TimeDelta::FromMilliseconds( |
+ layer_tree_impl()->settings().scrollbar_fade_delay_ms); |
+ scrollbar_animation_controller_->SetDelayOnScrollbarAnimation(delay); |
scrollbar_animation_controller_->DidScrollUpdate(); |
+ } |
} |
} |
} |