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/input/scrollbar_animation_controller_thinning.h" | 5 #include "cc/input/scrollbar_animation_controller_thinning.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "cc/layers/layer_impl.h" | 9 #include "cc/layers/layer_impl.h" |
10 #include "cc/layers/scrollbar_layer_impl_base.h" | 10 #include "cc/layers/scrollbar_layer_impl_base.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 captured_ = false; | 75 captured_ = false; |
76 | 76 |
77 if (!mouse_is_over_scrollbar_) | 77 if (!mouse_is_over_scrollbar_) |
78 opacity_change_ = DECREASE; | 78 opacity_change_ = DECREASE; |
79 if (!mouse_is_near_scrollbar_) | 79 if (!mouse_is_near_scrollbar_) |
80 thickness_change_ = DECREASE; | 80 thickness_change_ = DECREASE; |
81 StartAnimation(); | 81 StartAnimation(); |
82 } | 82 } |
83 | 83 |
84 void ScrollbarAnimationControllerThinning::DidMouseMoveOffScrollbar() { | 84 void ScrollbarAnimationControllerThinning::DidMouseMoveOffScrollbar() { |
85 if (!mouse_is_over_scrollbar_ && !mouse_is_near_scrollbar_) | |
86 return; | |
87 | |
88 mouse_is_over_scrollbar_ = false; | 85 mouse_is_over_scrollbar_ = false; |
89 mouse_is_near_scrollbar_ = false; | 86 mouse_is_near_scrollbar_ = false; |
90 | 87 |
91 if (captured_) | 88 if (captured_) |
92 return; | 89 return; |
93 | 90 |
94 opacity_change_ = DECREASE; | 91 opacity_change_ = DECREASE; |
95 thickness_change_ = DECREASE; | 92 thickness_change_ = DECREASE; |
96 StartAnimation(); | 93 StartAnimation(); |
97 } | 94 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 property_trees->effect_id_to_index_map[scrollbar->id()], | 196 property_trees->effect_id_to_index_map[scrollbar->id()], |
200 scrollbar->layer_tree_impl()); | 197 scrollbar->layer_tree_impl()); |
201 } | 198 } |
202 scrollbar->SetThumbThicknessScaleFactor(AdjustScale( | 199 scrollbar->SetThumbThicknessScaleFactor(AdjustScale( |
203 thumb_thickness_scale, scrollbar->thumb_thickness_scale_factor(), | 200 thumb_thickness_scale, scrollbar->thumb_thickness_scale_factor(), |
204 thickness_change_, kIdleThicknessScale, 1)); | 201 thickness_change_, kIdleThicknessScale, 1)); |
205 } | 202 } |
206 } | 203 } |
207 | 204 |
208 } // namespace cc | 205 } // namespace cc |
OLD | NEW |