| 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 #ifndef CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 5 #ifndef CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
| 6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void RunAnimationFrame(float progress) override; | 49 void RunAnimationFrame(float progress) override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // Describes whether the current animation should INCREASE (darken / thicken) | 52 // Describes whether the current animation should INCREASE (darken / thicken) |
| 53 // a bar or DECREASE it (lighten / thin). | 53 // a bar or DECREASE it (lighten / thin). |
| 54 enum AnimationChange { NONE, INCREASE, DECREASE }; | 54 enum AnimationChange { NONE, INCREASE, DECREASE }; |
| 55 float OpacityAtAnimationProgress(float progress); | 55 float OpacityAtAnimationProgress(float progress); |
| 56 float ThumbThicknessScaleAtAnimationProgress(float progress); | 56 float ThumbThicknessScaleAtAnimationProgress(float progress); |
| 57 float AdjustScale(float new_value, | 57 float AdjustScale(float new_value, |
| 58 float current_value, | 58 float current_value, |
| 59 AnimationChange animation_change); | 59 AnimationChange animation_change, |
| 60 float min_value, |
| 61 float max_value); |
| 60 void ApplyOpacityAndThumbThicknessScale(float opacity, | 62 void ApplyOpacityAndThumbThicknessScale(float opacity, |
| 61 float thumb_thickness_scale); | 63 float thumb_thickness_scale); |
| 62 | 64 |
| 63 bool mouse_is_over_scrollbar_; | 65 bool mouse_is_over_scrollbar_; |
| 64 bool mouse_is_near_scrollbar_; | 66 bool mouse_is_near_scrollbar_; |
| 65 // Are we narrowing or thickening the bars. | 67 // Are we narrowing or thickening the bars. |
| 66 AnimationChange thickness_change_; | 68 AnimationChange thickness_change_; |
| 67 // Are we darkening or lightening the bars. | 69 // Are we darkening or lightening the bars. |
| 68 AnimationChange opacity_change_; | 70 AnimationChange opacity_change_; |
| 69 // How close should the mouse be to the scrollbar before we thicken it. | 71 // How close should the mouse be to the scrollbar before we thicken it. |
| 70 float mouse_move_distance_to_trigger_animation_; | 72 float mouse_move_distance_to_trigger_animation_; |
| 71 | 73 |
| 72 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); | 74 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 } // namespace cc | 77 } // namespace cc |
| 76 | 78 |
| 77 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 79 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
| OLD | NEW |