| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/linear_animation.h" | 5 #include "app/linear_animation.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "app/animation_container.h" | |
| 10 | |
| 11 using base::Time; | 9 using base::Time; |
| 12 using base::TimeDelta; | 10 using base::TimeDelta; |
| 13 | 11 |
| 14 static TimeDelta CalculateInterval(int frame_rate) { | 12 static TimeDelta CalculateInterval(int frame_rate) { |
| 15 int timer_interval = 1000000 / frame_rate; | 13 int timer_interval = 1000000 / frame_rate; |
| 16 if (timer_interval < 10000) | 14 if (timer_interval < 10000) |
| 17 timer_interval = 10000; | 15 timer_interval = 10000; |
| 18 return TimeDelta::FromMicroseconds(timer_interval); | 16 return TimeDelta::FromMicroseconds(timer_interval); |
| 19 } | 17 } |
| 20 | 18 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 80 |
| 83 in_end_ = false; | 81 in_end_ = false; |
| 84 // Set state_ to ensure we send ended to delegate and not canceled. | 82 // Set state_ to ensure we send ended to delegate and not canceled. |
| 85 state_ = 1; | 83 state_ = 1; |
| 86 AnimateToState(1.0); | 84 AnimateToState(1.0); |
| 87 } | 85 } |
| 88 | 86 |
| 89 bool LinearAnimation::ShouldSendCanceledFromStop() { | 87 bool LinearAnimation::ShouldSendCanceledFromStop() { |
| 90 return state_ != 1; | 88 return state_ != 1; |
| 91 } | 89 } |
| OLD | NEW |