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

Unified Diff: ui/wm/core/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
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | ui/wm/core/window_animations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/window_animations.h
diff --git a/ui/wm/core/window_animations.h b/ui/wm/core/window_animations.h
index 73a817326b814a80f0588d048b803dd9e6381f78..b2ab4defb6cdf77e8b64390ddb5115c7a419fd65 100644
--- a/ui/wm/core/window_animations.h
+++ b/ui/wm/core/window_animations.h
@@ -7,6 +7,7 @@
#include <vector>
+#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/wm/core/wm_core_export.h"
namespace aura {
@@ -80,12 +81,27 @@ WM_CORE_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.
-WM_CORE_EXPORT ui::ImplicitAnimationObserver*
- CreateHidingWindowAnimationObserver(aura::Window* window);
+class HidingWindowAnimationObserver;
+// A wrapper of ui::ScopedLayerAnimationSettings for hiding animations.
+// Use this to ensure that the hiding animation is visible even after
+// the window is deleted or deactivated, instead of using
+// ui::ScopedLayerAnimationSettings directly.
+class WM_CORE_EXPORT ScopedHidingAnimationSettings {
+ public:
+ explicit ScopedHidingAnimationSettings(aura::Window* window);
+ ~ScopedHidingAnimationSettings();
+
+ // Returns the wrapped ScopedLayeAnimationSettings instance.
+ ui::ScopedLayerAnimationSettings* layer_animation_settings() {
+ return &layer_animation_settings_;
+ }
+
+ private:
+ ui::ScopedLayerAnimationSettings layer_animation_settings_;
+ HidingWindowAnimationObserver* observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedHidingAnimationSettings);
+};
// Returns false if the |window| didn't animate.
WM_CORE_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window,
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | ui/wm/core/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698