Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: ui/base/animation/linear_animation.cc

Issue 6154001: Move animation code to new ui/base/animation directory.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/animation/linear_animation.h ('k') | ui/base/animation/multi_animation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 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 "app/linear_animation.h" 5 #include "ui/base/animation/linear_animation.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "app/animation_container.h" 9 #include "ui/base/animation/animation_container.h"
10 #include "app/animation_delegate.h" 10 #include "ui/base/animation/animation_delegate.h"
11 11
12 using base::Time; 12 using base::Time;
13 using base::TimeDelta; 13 using base::TimeDelta;
14 14
15 namespace ui {
16
15 static TimeDelta CalculateInterval(int frame_rate) { 17 static TimeDelta CalculateInterval(int frame_rate) {
16 int timer_interval = 1000000 / frame_rate; 18 int timer_interval = 1000000 / frame_rate;
17 if (timer_interval < 10000) 19 if (timer_interval < 10000)
18 timer_interval = 10000; 20 timer_interval = 10000;
19 return TimeDelta::FromMicroseconds(timer_interval); 21 return TimeDelta::FromMicroseconds(timer_interval);
20 } 22 }
21 23
22 LinearAnimation::LinearAnimation(int frame_rate, 24 LinearAnimation::LinearAnimation(int frame_rate,
23 AnimationDelegate* delegate) 25 AnimationDelegate* delegate)
24 : Animation(CalculateInterval(frame_rate)), 26 : Animation(CalculateInterval(frame_rate)),
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 85
84 in_end_ = false; 86 in_end_ = false;
85 // Set state_ to ensure we send ended to delegate and not canceled. 87 // Set state_ to ensure we send ended to delegate and not canceled.
86 state_ = 1; 88 state_ = 1;
87 AnimateToState(1.0); 89 AnimateToState(1.0);
88 } 90 }
89 91
90 bool LinearAnimation::ShouldSendCanceledFromStop() { 92 bool LinearAnimation::ShouldSendCanceledFromStop() {
91 return state_ != 1; 93 return state_ != 1;
92 } 94 }
95
96 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/animation/linear_animation.h ('k') | ui/base/animation/multi_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698