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

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: ScopedHidingAnimationSettings 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 2c7997d9538a647ba306e278cd304a1ab8905ba3..e3805f53535fd135302fabedaee270c6895ef8cf 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 {
@@ -81,12 +82,37 @@ 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);
+// A wrapper of ui::ScopedLayerAnimationSettings for hiding animations.
+// Use this to ensure that the animation is visible even after
+// the window is deleted, instead of directly using
+// ui::ScopedLayerAnimationSettings.
+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_;
+ }
+
+ // When set to true, this recreates layers for the window and and puts
sky 2014/03/13 21:09:37 Document when you would want to do this. Can you p
oshima 2014/03/13 22:03:16 I added an example.
sky 2014/03/13 22:04:05 Then add an enum.
+ // the original (and animating) layers on top of the |window_| and
sky 2014/03/13 21:09:37 'the |window_|' -> |window_|
oshima 2014/03/13 22:03:16 Done.
+ // its transient children so that these layers stay above new
+ // focused window.
+ // Note that this is effective only if the |window| has a focus when
sky 2014/03/13 21:09:37 'a focus' -> focus
oshima 2014/03/13 22:03:16 Done.
+ // applying the animation.
+ void set_ensure_visible_after_focus_lost(bool value) {
+ ensure_visibility_after_focus_lost_ = value;
sky 2014/03/13 21:09:37 Make field and method name match here.
oshima 2014/03/13 22:03:16 Done.
+ }
+
+ private:
+ aura::Window* window_;
+ bool ensure_visibility_after_focus_lost_;
+ ui::ScopedLayerAnimationSettings layer_animation_settings_;
+
+ 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