OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/gfx/animation/linear_animation.h" | 5 #include "ui/gfx/animation/linear_animation.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
| 9 #include <algorithm> |
| 10 |
9 #include "ui/gfx/animation/animation_container.h" | 11 #include "ui/gfx/animation/animation_container.h" |
10 #include "ui/gfx/animation/animation_delegate.h" | 12 #include "ui/gfx/animation/animation_delegate.h" |
11 | 13 |
12 using base::Time; | 14 using base::Time; |
13 using base::TimeDelta; | 15 using base::TimeDelta; |
14 | 16 |
15 namespace gfx { | 17 namespace gfx { |
16 | 18 |
17 static TimeDelta CalculateInterval(int frame_rate) { | 19 static TimeDelta CalculateInterval(int frame_rate) { |
18 int timer_interval = 1000000 / frame_rate; | 20 int timer_interval = 1000000 / frame_rate; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // Set state_ to ensure we send ended to delegate and not canceled. | 101 // Set state_ to ensure we send ended to delegate and not canceled. |
100 state_ = 1; | 102 state_ = 1; |
101 AnimateToState(1.0); | 103 AnimateToState(1.0); |
102 } | 104 } |
103 | 105 |
104 bool LinearAnimation::ShouldSendCanceledFromStop() { | 106 bool LinearAnimation::ShouldSendCanceledFromStop() { |
105 return state_ != 1; | 107 return state_ != 1; |
106 } | 108 } |
107 | 109 |
108 } // namespace gfx | 110 } // namespace gfx |
OLD | NEW |