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 |
85 mouse_is_over_scrollbar_ = false; | 88 mouse_is_over_scrollbar_ = false; |
86 mouse_is_near_scrollbar_ = false; | 89 mouse_is_near_scrollbar_ = false; |
87 | 90 |
88 if (captured_) | 91 if (captured_) |
89 return; | 92 return; |
90 | 93 |
91 opacity_change_ = DECREASE; | 94 opacity_change_ = DECREASE; |
92 thickness_change_ = DECREASE; | 95 thickness_change_ = DECREASE; |
93 StartAnimation(); | 96 StartAnimation(); |
94 } | 97 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 property_trees->effect_id_to_index_map[scrollbar->id()], | 199 property_trees->effect_id_to_index_map[scrollbar->id()], |
197 scrollbar->layer_tree_impl()); | 200 scrollbar->layer_tree_impl()); |
198 } | 201 } |
199 scrollbar->SetThumbThicknessScaleFactor(AdjustScale( | 202 scrollbar->SetThumbThicknessScaleFactor(AdjustScale( |
200 thumb_thickness_scale, scrollbar->thumb_thickness_scale_factor(), | 203 thumb_thickness_scale, scrollbar->thumb_thickness_scale_factor(), |
201 thickness_change_, kIdleThicknessScale, 1)); | 204 thickness_change_, kIdleThicknessScale, 1)); |
202 } | 205 } |
203 } | 206 } |
204 | 207 |
205 } // namespace cc | 208 } // namespace cc |
OLD | NEW |