diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-16 01:00:34 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-16 01:00:34 +0000 |
commit | 380aeaf0c6f3e4ab8ae8b2acbab2616eb83e445a (patch) | |
tree | dae23a5a4250e83974f1b538411f7874ab9a133e /ui/views/animation | |
parent | 26dc99aa8ecc3b19c8c8d51e8d302e7358ee01d6 (diff) | |
download | chromium_src-380aeaf0c6f3e4ab8ae8b2acbab2616eb83e445a.zip chromium_src-380aeaf0c6f3e4ab8ae8b2acbab2616eb83e445a.tar.gz chromium_src-380aeaf0c6f3e4ab8ae8b2acbab2616eb83e445a.tar.bz2 |
ash/app_list: Make app list bubble move with launcher app list button.
BUG=131693
TEST=Verify that app list bubble moves with launcher app list button when pinning/unpinning from app list grid.
Review URL: https://chromiumcodereview.appspot.com/10535170
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/animation')
-rw-r--r-- | ui/views/animation/bounds_animator.cc | 5 | ||||
-rw-r--r-- | ui/views/animation/bounds_animator.h | 8 | ||||
-rw-r--r-- | ui/views/animation/bounds_animator_observer.h | 29 |
3 files changed, 35 insertions, 7 deletions
diff --git a/ui/views/animation/bounds_animator.cc b/ui/views/animation/bounds_animator.cc index 3e7c93e..b6df3fb 100644 --- a/ui/views/animation/bounds_animator.cc +++ b/ui/views/animation/bounds_animator.cc @@ -7,6 +7,7 @@ #include "base/memory/scoped_ptr.h" #include "ui/base/animation/animation_container.h" #include "ui/base/animation/slide_animation.h" +#include "ui/views/animation/bounds_animator_observer.h" #include "ui/views/view.h" // Duration in milliseconds for animations. @@ -261,6 +262,10 @@ void BoundsAnimator::AnimationContainerProgressed( repaint_bounds_.SetRect(0, 0, 0, 0); } + FOR_EACH_OBSERVER(BoundsAnimatorObserver, + observers_, + OnBoundsAnimatorProgressed(this)); + if (!IsAnimating()) { // Notify here rather than from AnimationXXX to avoid deleting the animation // while the animation is calling us. diff --git a/ui/views/animation/bounds_animator.h b/ui/views/animation/bounds_animator.h index f84c2d0..8884fbb 100644 --- a/ui/views/animation/bounds_animator.h +++ b/ui/views/animation/bounds_animator.h @@ -22,15 +22,9 @@ class SlideAnimation; namespace views { -class BoundsAnimator; +class BoundsAnimatorObserver; class View; -class VIEWS_EXPORT BoundsAnimatorObserver { - public: - // Invoked when all animations are complete. - virtual void OnBoundsAnimatorDone(BoundsAnimator* animator) = 0; -}; - // Bounds animator is responsible for animating the bounds of a view from the // the views current location and size to a target position and size. To use // BoundsAnimator invoke AnimateViewTo for the set of views you want to diff --git a/ui/views/animation/bounds_animator_observer.h b/ui/views/animation/bounds_animator_observer.h new file mode 100644 index 0000000..8b606a3 --- /dev/null +++ b/ui/views/animation/bounds_animator_observer.h @@ -0,0 +1,29 @@ +// 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. + +#ifndef UI_VIEWS_ANIMATION_BOUNDS_ANIMATOR_OBSERVER_H_ +#define UI_VIEWS_ANIMATION_BOUNDS_ANIMATOR_OBSERVER_H_ +#pragma once + +#include "ui/views/views_export.h" + +namespace views { + +class BoundsAnimator; + +class VIEWS_EXPORT BoundsAnimatorObserver { + public: + // Invoked when animations have progressed. + virtual void OnBoundsAnimatorProgressed(BoundsAnimator* animator) = 0; + + // Invoked when all animations are complete. + virtual void OnBoundsAnimatorDone(BoundsAnimator* animator) = 0; + + protected: + virtual ~BoundsAnimatorObserver() {} +}; + +} // namespace views + +#endif // UI_VIEWS_ANIMATION_BOUNDS_ANIMATOR_OBSERVER_H_ |