Chromium Code Reviews| Index: ui/views/corewm/window_animations.h |
| diff --git a/ui/views/corewm/window_animations.h b/ui/views/corewm/window_animations.h |
| index f5728e6add64fc4ad60b8244540c8c6c28efec62..615017f4d5bb6712d4de13b65748c0e0fb038f6e 100644 |
| --- a/ui/views/corewm/window_animations.h |
| +++ b/ui/views/corewm/window_animations.h |
| @@ -7,6 +7,7 @@ |
| #include <vector> |
| +#include "base/memory/scoped_ptr.h" |
| #include "ui/views/views_export.h" |
| namespace aura { |
| @@ -22,6 +23,7 @@ namespace ui { |
| class ImplicitAnimationObserver; |
| class Layer; |
| class LayerAnimationSequence; |
| +class ScopedLayerAnimationSettings; |
| } |
| namespace views { |
| @@ -81,12 +83,46 @@ VIEWS_EXPORT void SetWindowVisibilityAnimationVerticalPosition( |
| aura::Window* window, |
| float position); |
| -// Creates an ImplicitAnimationObserver that takes ownership of the layers |
| -// associated with a Window so that the animation can continue after the Window |
| -// has been destroyed. |
| -// The returned object deletes itself when the animations are done. |
| -VIEWS_EXPORT ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( |
| - aura::Window* window); |
| +class DetachAndRecreateLayersAnimationObserver; |
| +// A scoped object which detaches the current layers which will animate, and |
| +// recreates new layers for the window upon deletion of this object. |
| +// Layers are owned by the animation observer that is added to the |
| +// detached layer's animator, and will be deleted when the animation |
| +// is completed. This is intended to be a return value of |
| +// DetachAndRecreateLayersForHidingAnimation() and not to be created by |
| +// a client code. |
| +class LayerDetacherForHidingAnimation { |
| + public: |
| + LayerDetacherForHidingAnimation( |
| + aura::Window* window, |
| + ui::ScopedLayerAnimationSettings* settings); |
| + ~LayerDetacherForHidingAnimation(); |
| + |
| + private: |
| + DetachAndRecreateLayersAnimationObserver* observer_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LayerDetacherForHidingAnimation); |
| +}; |
| + |
| +// This is used to make sure the hiding animation is visible even if |
| +// the activation changes. |
| +// This should be called before applying animatinos to |settings| |
|
sky
2014/03/11 19:16:23
animatinos->animations
|
| +// as this installs an animation observer and the returned object should |
| +// have the same scope as |settings|. |
| +VIEWS_EXPORT scoped_ptr<LayerDetacherForHidingAnimation> |
| + DetachAndRecreateLayersForHidingAnimation( |
| + aura::Window* window, |
| + ui::ScopedLayerAnimationSettings* settings) WARN_UNUSED_RESULT; |
| + |
| +// This installs a window observer that takes ownership of the layers |
| +// associated with a winddow. This is used to make sure that the |
|
sky
2014/03/11 19:16:23
winddow->window
|
| +// hiding animation can continue after the window has been destroyed. |
| +// this will install an animation observer. |
|
sky
2014/03/11 19:16:23
this->THis
|
| +// This should be called before applying animatinos to |settings| as |
| +// this installs an animation observer. |
| +VIEWS_EXPORT void DetachLayersForHidingAnimationWhenDestroyed( |
| + aura::Window* window, |
| + ui::ScopedLayerAnimationSettings* settings); |
| // Returns false if the |window| didn't animate. |
| VIEWS_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, |