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

Side by Side Diff: chrome/common/slide_animation.cc

Issue 2929: Some initial work on compiling chrome/common/ on Linux.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | « chrome/common/pref_member.h ('k') | chrome/common/stl_util-inl.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/common/slide_animation.h" 5 #include "chrome/common/slide_animation.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 // How many frames per second to target. 9 // How many frames per second to target.
10 static const int kDefaultFramerateHz = 50; 10 static const int kDefaultFramerateHz = 50;
11 11
12 // How long animations should take by default. 12 // How long animations should take by default.
13 static const int kDefaultDurationMs = 120; 13 static const int kDefaultDurationMs = 120;
14 14
15 SlideAnimation::SlideAnimation(AnimationDelegate* target) 15 SlideAnimation::SlideAnimation(AnimationDelegate* target)
16 : Animation(kDefaultFramerateHz, target), 16 : Animation(kDefaultFramerateHz, target),
17 target_(target), 17 target_(target),
18 tween_type_(EASE_OUT),
18 showing_(false), 19 showing_(false),
19 value_start_(0), 20 value_start_(0),
20 value_end_(0), 21 value_end_(0),
21 value_current_(0), 22 value_current_(0),
22 tween_type_(EASE_OUT),
23 slide_duration_(kDefaultDurationMs) { 23 slide_duration_(kDefaultDurationMs) {
24 } 24 }
25 25
26 SlideAnimation::~SlideAnimation() { 26 SlideAnimation::~SlideAnimation() {
27 } 27 }
28 28
29 void SlideAnimation::Reset() { 29 void SlideAnimation::Reset() {
30 Reset(0); 30 Reset(0);
31 } 31 }
32 32
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 value_current_ = value_end_; 117 value_current_ = value_end_;
118 118
119 // Correct for any overshoot (while state may be capped at 1.0, let's not 119 // Correct for any overshoot (while state may be capped at 1.0, let's not
120 // take any rounding error chances. 120 // take any rounding error chances.
121 if ((value_end_ >= value_start_ && value_current_ > value_end_) || 121 if ((value_end_ >= value_start_ && value_current_ > value_end_) ||
122 (value_end_ < value_start_ && value_current_ < value_end_)) { 122 (value_end_ < value_start_ && value_current_ < value_end_)) {
123 value_current_ = value_end_; 123 value_current_ = value_end_;
124 } 124 }
125 } 125 }
126 126
OLDNEW
« no previous file with comments | « chrome/common/pref_member.h ('k') | chrome/common/stl_util-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698