summaryrefslogtreecommitdiffstats
path: root/ui/views/animation
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-16 01:41:34 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-16 01:41:34 +0000
commitafcd9bb70c778ecb65a7e46d639c9624e93aafcc (patch)
tree1735c78a65444cd2082cfe58084c2e1921da4203 /ui/views/animation
parentd6831e9524e56ac3b5b338a137e019a23b7bb9cb (diff)
downloadchromium_src-afcd9bb70c778ecb65a7e46d639c9624e93aafcc.zip
chromium_src-afcd9bb70c778ecb65a7e46d639c9624e93aafcc.tar.gz
chromium_src-afcd9bb70c778ecb65a7e46d639c9624e93aafcc.tar.bz2
Adds way to set Tween::Type on BoundsAnimator.
BUG=none TEST=none R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10566015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/animation')
-rw-r--r--ui/views/animation/bounds_animator.cc5
-rw-r--r--ui/views/animation/bounds_animator.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/ui/views/animation/bounds_animator.cc b/ui/views/animation/bounds_animator.cc
index b6df3fb..18ae47a 100644
--- a/ui/views/animation/bounds_animator.cc
+++ b/ui/views/animation/bounds_animator.cc
@@ -23,7 +23,8 @@ namespace views {
BoundsAnimator::BoundsAnimator(View* parent)
: parent_(parent),
container_(new AnimationContainer()),
- animation_duration_ms_(kDefaultAnimationDuration) {
+ animation_duration_ms_(kDefaultAnimationDuration),
+ tween_type_(Tween::EASE_OUT) {
container_->set_observer(this);
}
@@ -154,7 +155,7 @@ SlideAnimation* BoundsAnimator::CreateAnimation() {
SlideAnimation* animation = new SlideAnimation(this);
animation->SetContainer(container_.get());
animation->SetSlideDuration(animation_duration_ms_);
- animation->SetTweenType(Tween::EASE_OUT);
+ animation->SetTweenType(tween_type_);
return animation;
}
diff --git a/ui/views/animation/bounds_animator.h b/ui/views/animation/bounds_animator.h
index 8884fbb..3bbbc4a 100644
--- a/ui/views/animation/bounds_animator.h
+++ b/ui/views/animation/bounds_animator.h
@@ -13,6 +13,7 @@
#include "base/observer_list.h"
#include "ui/base/animation/animation_container_observer.h"
#include "ui/base/animation/animation_delegate.h"
+#include "ui/base/animation/tween.h"
#include "ui/gfx/rect.h"
#include "ui/views/views_export.h"
@@ -91,6 +92,9 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate,
// milliseconds.
void SetAnimationDuration(int duration_ms);
+ // Sets the tween type for new animations. Default is EASE_OUT.
+ void set_tween_type(ui::Tween::Type type) { tween_type_ = type; }
+
void AddObserver(BoundsAnimatorObserver* observer);
void RemoveObserver(BoundsAnimatorObserver* observer);
@@ -182,6 +186,8 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate,
int animation_duration_ms_;
+ ui::Tween::Type tween_type_;
+
DISALLOW_COPY_AND_ASSIGN(BoundsAnimator);
};