OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/animation/scrollbar_animation_controller_linear_fade.h" | 5 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" |
6 | 6 |
7 #include "base/time.h" | 7 #include "base/time/time.h" |
8 #include "cc/layers/layer_impl.h" | 8 #include "cc/layers/layer_impl.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 scoped_ptr<ScrollbarAnimationControllerLinearFade> | 12 scoped_ptr<ScrollbarAnimationControllerLinearFade> |
13 ScrollbarAnimationControllerLinearFade::Create(LayerImpl* scroll_layer, | 13 ScrollbarAnimationControllerLinearFade::Create(LayerImpl* scroll_layer, |
14 base::TimeDelta fadeout_delay, | 14 base::TimeDelta fadeout_delay, |
15 base::TimeDelta fadeout_length) { | 15 base::TimeDelta fadeout_length) { |
16 return make_scoped_ptr(new ScrollbarAnimationControllerLinearFade( | 16 return make_scoped_ptr(new ScrollbarAnimationControllerLinearFade( |
17 scroll_layer, fadeout_delay, fadeout_length)); | 17 scroll_layer, fadeout_delay, fadeout_length)); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (delta <= fadeout_delay_) | 86 if (delta <= fadeout_delay_) |
87 return 1.0f; | 87 return 1.0f; |
88 if (delta < fadeout_delay_ + fadeout_length_) { | 88 if (delta < fadeout_delay_ + fadeout_length_) { |
89 return (fadeout_delay_ + fadeout_length_ - delta).InSecondsF() / | 89 return (fadeout_delay_ + fadeout_length_ - delta).InSecondsF() / |
90 fadeout_length_.InSecondsF(); | 90 fadeout_length_.InSecondsF(); |
91 } | 91 } |
92 return 0.0f; | 92 return 0.0f; |
93 } | 93 } |
94 | 94 |
95 } // namespace cc | 95 } // namespace cc |
OLD | NEW |