| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_WM_CORE_WINDOW_ANIMATIONS_H_ | 5 #ifndef UI_WM_CORE_WINDOW_ANIMATIONS_H_ |
| 6 #define UI_WM_CORE_WINDOW_ANIMATIONS_H_ | 6 #define UI_WM_CORE_WINDOW_ANIMATIONS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 10 #include "ui/wm/core/wm_core_export.h" | 11 #include "ui/wm/core/wm_core_export.h" |
| 11 | 12 |
| 12 namespace aura { | 13 namespace aura { |
| 13 class Window; | 14 class Window; |
| 14 } | 15 } |
| 15 namespace base { | 16 namespace base { |
| 16 class TimeDelta; | 17 class TimeDelta; |
| 17 } | 18 } |
| 18 namespace gfx { | 19 namespace gfx { |
| 19 class Rect; | 20 class Rect; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 aura::Window* window, | 74 aura::Window* window, |
| 74 const base::TimeDelta& duration); | 75 const base::TimeDelta& duration); |
| 75 | 76 |
| 76 WM_CORE_EXPORT base::TimeDelta GetWindowVisibilityAnimationDuration( | 77 WM_CORE_EXPORT base::TimeDelta GetWindowVisibilityAnimationDuration( |
| 77 const aura::Window& window); | 78 const aura::Window& window); |
| 78 | 79 |
| 79 WM_CORE_EXPORT void SetWindowVisibilityAnimationVerticalPosition( | 80 WM_CORE_EXPORT void SetWindowVisibilityAnimationVerticalPosition( |
| 80 aura::Window* window, | 81 aura::Window* window, |
| 81 float position); | 82 float position); |
| 82 | 83 |
| 83 // Creates an ImplicitAnimationObserver that takes ownership of the layers | 84 class HidingWindowAnimationObserver; |
| 84 // associated with a Window so that the animation can continue after the Window | 85 // A wrapper of ui::ScopedLayerAnimationSettings for hiding animations. |
| 85 // has been destroyed. | 86 // Use this to ensure that the hiding animation is visible even after |
| 86 // The returned object deletes itself when the animations are done. | 87 // the window is deleted or deactivated, instead of using |
| 87 WM_CORE_EXPORT ui::ImplicitAnimationObserver* | 88 // ui::ScopedLayerAnimationSettings directly. |
| 88 CreateHidingWindowAnimationObserver(aura::Window* window); | 89 class WM_CORE_EXPORT ScopedHidingAnimationSettings { |
| 90 public: |
| 91 explicit ScopedHidingAnimationSettings(aura::Window* window); |
| 92 ~ScopedHidingAnimationSettings(); |
| 93 |
| 94 // Returns the wrapped ScopedLayeAnimationSettings instance. |
| 95 ui::ScopedLayerAnimationSettings* layer_animation_settings() { |
| 96 return &layer_animation_settings_; |
| 97 } |
| 98 |
| 99 private: |
| 100 ui::ScopedLayerAnimationSettings layer_animation_settings_; |
| 101 HidingWindowAnimationObserver* observer_; |
| 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(ScopedHidingAnimationSettings); |
| 104 }; |
| 89 | 105 |
| 90 // Returns false if the |window| didn't animate. | 106 // Returns false if the |window| didn't animate. |
| 91 WM_CORE_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, | 107 WM_CORE_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, |
| 92 bool visible); | 108 bool visible); |
| 93 WM_CORE_EXPORT bool AnimateWindow(aura::Window* window, | 109 WM_CORE_EXPORT bool AnimateWindow(aura::Window* window, |
| 94 WindowAnimationType type); | 110 WindowAnimationType type); |
| 95 | 111 |
| 96 // Returns true if window animations are disabled for |window|. Window | 112 // Returns true if window animations are disabled for |window|. Window |
| 97 // animations are enabled by default. If |window| is NULL, this just checks | 113 // animations are enabled by default. If |window| is NULL, this just checks |
| 98 // if the global flag disabling window animations is present. | 114 // if the global flag disabling window animations is present. |
| 99 WM_CORE_EXPORT bool WindowAnimationsDisabled(aura::Window* window); | 115 WM_CORE_EXPORT bool WindowAnimationsDisabled(aura::Window* window); |
| 100 | 116 |
| 101 } // namespace wm | 117 } // namespace wm |
| 102 | 118 |
| 103 #endif // UI_WM_CORE_WINDOW_ANIMATIONS_H_ | 119 #endif // UI_WM_CORE_WINDOW_ANIMATIONS_H_ |
| OLD | NEW |