diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 15:41:38 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 15:41:38 +0000 |
commit | 8b43093169597d0bdc66181b4c14e5af344880cf (patch) | |
tree | b5ad7104f61765816f9f071b3adf0610641fe9a6 /views/animation | |
parent | e0e9ab380b95da06e375610fd10d07c5190527cb (diff) | |
download | chromium_src-8b43093169597d0bdc66181b4c14e5af344880cf.zip chromium_src-8b43093169597d0bdc66181b4c14e5af344880cf.tar.gz chromium_src-8b43093169597d0bdc66181b4c14e5af344880cf.tar.bz2 |
Makes dragging multiple discontingious tabs animate the tabs into
place.
BUG=30572
TEST=none, just make sure tab selection isn't broken.
R=ben@chromium.org
Review URL: http://codereview.chromium.org/6712012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78695 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/animation')
-rw-r--r-- | views/animation/bounds_animator.cc | 9 | ||||
-rw-r--r-- | views/animation/bounds_animator.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/views/animation/bounds_animator.cc b/views/animation/bounds_animator.cc index 09d880e..7039eb7 100644 --- a/views/animation/bounds_animator.cc +++ b/views/animation/bounds_animator.cc @@ -68,6 +68,15 @@ void BoundsAnimator::AnimateViewTo(View* view, const gfx::Rect& target) { CleanupData(true, &existing_data, NULL); } +void BoundsAnimator::SetTargetBounds(View* view, const gfx::Rect& target) { + if (!IsAnimating(view)) { + AnimateViewTo(view, target); + return; + } + + data_[view].target_bounds = target; +} + void BoundsAnimator::SetAnimationForView(View* view, SlideAnimation* animation) { DCHECK(animation); diff --git a/views/animation/bounds_animator.h b/views/animation/bounds_animator.h index d771912..e11f484 100644 --- a/views/animation/bounds_animator.h +++ b/views/animation/bounds_animator.h @@ -57,6 +57,11 @@ class BoundsAnimator : public ui::AnimationDelegate, // (after being notified that the animation was canceled). void AnimateViewTo(View* view, const gfx::Rect& target); + // Similar to |AnimateViewTo|, but does not reset the animation, only the + // target bounds. If |view| is not being animated this is the same as + // invoking |AnimateViewTo|. + void SetTargetBounds(View* view, const gfx::Rect& target); + // Sets the animation for the specified view. BoundsAnimator takes ownership // of the specified animation. void SetAnimationForView(View* view, ui::SlideAnimation* animation); |