| 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/scrollbar_animation_controller_linear_fade.h" | 5 #include "cc/scrollbar_animation_controller_linear_fade.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "cc/layer_impl.h" | 8 #include "cc/layer_impl.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 { | 24 { |
| 25 } | 25 } |
| 26 | 26 |
| 27 ScrollbarAnimationControllerLinearFade::~ScrollbarAnimationControllerLinearFade(
) | 27 ScrollbarAnimationControllerLinearFade::~ScrollbarAnimationControllerLinearFade(
) |
| 28 { | 28 { |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool ScrollbarAnimationControllerLinearFade::animate(base::TimeTicks now) | 31 bool ScrollbarAnimationControllerLinearFade::animate(base::TimeTicks now) |
| 32 { | 32 { |
| 33 float opacity = opacityAtTime(now); | 33 float opacity = opacityAtTime(now); |
| 34 m_scrollLayer->setScrollbarOpacity(opacity); | 34 m_scrollLayer->SetScrollbarOpacity(opacity); |
| 35 return opacity; | 35 return opacity; |
| 36 } | 36 } |
| 37 | 37 |
| 38 void ScrollbarAnimationControllerLinearFade::didPinchGestureUpdate(base::TimeTic
ks now) | 38 void ScrollbarAnimationControllerLinearFade::didPinchGestureUpdate(base::TimeTic
ks now) |
| 39 { | 39 { |
| 40 m_pinchGestureInEffect = true; | 40 m_pinchGestureInEffect = true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void ScrollbarAnimationControllerLinearFade::didPinchGestureEnd(base::TimeTicks
now) | 43 void ScrollbarAnimationControllerLinearFade::didPinchGestureEnd(base::TimeTicks
now) |
| 44 { | 44 { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 double delta = (now - m_lastAwakenTime).InSecondsF(); | 62 double delta = (now - m_lastAwakenTime).InSecondsF(); |
| 63 | 63 |
| 64 if (delta <= m_fadeoutDelay) | 64 if (delta <= m_fadeoutDelay) |
| 65 return 1; | 65 return 1; |
| 66 if (delta < m_fadeoutDelay + m_fadeoutLength) | 66 if (delta < m_fadeoutDelay + m_fadeoutLength) |
| 67 return (m_fadeoutDelay + m_fadeoutLength - delta) / m_fadeoutLength; | 67 return (m_fadeoutDelay + m_fadeoutLength - delta) / m_fadeoutLength; |
| 68 return 0; | 68 return 0; |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace cc | 71 } // namespace cc |
| OLD | NEW |