Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Unified Diff: ui/views/corewm/window_animations.h

Issue 180273025: Keep dedicated layers for hiding animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698