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

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..53c12712d2357df935ddc5314e3cea5193fd8df2 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,33 @@ 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);
+
+// A scoped object which detaches the current layers which will animate and
+// recreates new layers for the window. Layers are owned by the animation
+// observer that is added to the deteached layer's animator, and will be deleted
+// when the animation is completed.
+class LayerDetacherForHidingAnimation {
+ public:
+ LayerDetacherForHidingAnimation() {}
+ virtual ~LayerDetacherForHidingAnimation() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LayerDetacherForHidingAnimation);
+};
+
+// This has to be called before applying animations to |settings| because
sky 2014/03/10 13:30:40 Is there anyway to this has been called before app
oshima 2014/03/10 17:48:24 Not sure if I understood your question correctly.
+// this will install animation observer.
sky 2014/03/10 13:30:40 an animation observer
oshima 2014/03/10 17:48:24 Done.
+VIEWS_EXPORT scoped_ptr<LayerDetacherForHidingAnimation>
+ DetachAndRecreateLayersForHidingAnimation(
+ aura::Window* window,
+ ui::ScopedLayerAnimationSettings* settings);
+
+// This installs a window observer that takes ownership of the layers
+// associated with a |winddow| so that the hiding animation can continue
sky 2014/03/10 13:30:40 'a |winddow|' -> "window"
oshima 2014/03/10 17:48:24 Done.
+// after the window has been destroyed.
+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