diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 02:08:54 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 02:08:54 +0000 |
commit | cec3dc4cbab2fbe94089a5177ee4191d6cf6e7ac (patch) | |
tree | 47f7996fc980983af1ede8ebeb48c751dded5b01 /ui/views/animation/bounds_animator.h | |
parent | 6e8ac9af5c73f256555d2e3b2782ad82e44350c9 (diff) | |
download | chromium_src-cec3dc4cbab2fbe94089a5177ee4191d6cf6e7ac.zip chromium_src-cec3dc4cbab2fbe94089a5177ee4191d6cf6e7ac.tar.gz chromium_src-cec3dc4cbab2fbe94089a5177ee4191d6cf6e7ac.tar.bz2 |
ash: Fix launcher icon overlaps with status.
- Make LauncherView::CalculateIdealBounds to return last visible index;
- In LauncherView::LauncherItemAdded, use the last visible index to determine if
we need the animation;
BUG=122482
TEST=Verify fix for issue 122482.
Review URL: http://codereview.chromium.org/10068027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/animation/bounds_animator.h')
-rw-r--r-- | ui/views/animation/bounds_animator.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/ui/views/animation/bounds_animator.h b/ui/views/animation/bounds_animator.h index d0e2c2e..f84c2d0 100644 --- a/ui/views/animation/bounds_animator.h +++ b/ui/views/animation/bounds_animator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" +#include "base/observer_list.h" #include "ui/base/animation/animation_container_observer.h" #include "ui/base/animation/animation_delegate.h" #include "ui/gfx/rect.h" @@ -24,7 +25,7 @@ namespace views { class BoundsAnimator; class View; -class BoundsAnimatorObserver { +class VIEWS_EXPORT BoundsAnimatorObserver { public: // Invoked when all animations are complete. virtual void OnBoundsAnimatorDone(BoundsAnimator* animator) = 0; @@ -92,9 +93,12 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, // size. Any views marked for deletion are deleted. void Cancel(); - void set_observer(BoundsAnimatorObserver* observer) { - observer_ = observer; - } + // Overrides default animation duration. |duration_ms| is the new duration in + // milliseconds. + void SetAnimationDuration(int duration_ms); + + void AddObserver(BoundsAnimatorObserver* observer); + void RemoveObserver(BoundsAnimatorObserver* observer); protected: // Creates the animation to use for animating views. @@ -165,7 +169,7 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, // Parent of all views being animated. View* parent_; - BoundsAnimatorObserver* observer_; + ObserverList<BoundsAnimatorObserver> observers_; // All animations we create up with the same container. scoped_refptr<ui::AnimationContainer> container_; @@ -182,6 +186,8 @@ class VIEWS_EXPORT BoundsAnimator : public ui::AnimationDelegate, // to repaint these bounds. gfx::Rect repaint_bounds_; + int animation_duration_ms_; + DISALLOW_COPY_AND_ASSIGN(BoundsAnimator); }; |