| 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 ASH_WM_SESSION_STATE_ANIMATOR_H_ | 5 #ifndef ASH_WM_SESSION_STATE_ANIMATOR_H_ |
| 6 #define ASH_WM_SESSION_STATE_ANIMATOR_H_ | 6 #define ASH_WM_SESSION_STATE_ANIMATOR_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/wm/workspace/colored_window_controller.h" | 9 #include "ash/wm/workspace/colored_window_controller.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Destroy |foreground_| when it is not needed anymore. | 120 // Destroy |foreground_| when it is not needed anymore. |
| 121 void DropForeground(); | 121 void DropForeground(); |
| 122 | 122 |
| 123 // Drops back layer after |UNDO_SLOW_CLOSE| animation delay. | 123 // Drops back layer after |UNDO_SLOW_CLOSE| animation delay. |
| 124 void ScheduleDropBlackLayer(); | 124 void ScheduleDropBlackLayer(); |
| 125 | 125 |
| 126 // Apply animation |type| to all containers included in |container_mask|. | 126 // Apply animation |type| to all containers included in |container_mask|. |
| 127 void StartAnimation(int container_mask, | 127 void StartAnimation(int container_mask, |
| 128 AnimationType type); | 128 AnimationType type); |
| 129 | 129 |
| 130 // Apply animation |type| to all containers included in |container_mask| and |
| 131 // call a |callback| at the end of the animation, if it is not null. |
| 132 void StartAnimationWithCallback(int container_mask, |
| 133 AnimationType type, |
| 134 base::Callback<void(void)>& callback); |
| 135 |
| 130 // Fills |containers| with the containers included in |container_mask|. | 136 // Fills |containers| with the containers included in |container_mask|. |
| 131 void GetContainers(int container_mask, | 137 void GetContainers(int container_mask, |
| 132 aura::Window::Windows* containers); | 138 aura::Window::Windows* containers); |
| 133 | 139 |
| 134 // aura::RootWindowObserver overrides: | 140 // aura::RootWindowObserver overrides: |
| 135 virtual void OnRootWindowResized(const aura::RootWindow* root, | 141 virtual void OnRootWindowResized(const aura::RootWindow* root, |
| 136 const gfx::Size& old_size) OVERRIDE; | 142 const gfx::Size& old_size) OVERRIDE; |
| 137 | 143 |
| 138 private: | 144 private: |
| 145 // Apply animation |type| to window |window| and add |observer| if it is not |
| 146 // NULL to the last animation sequence. |
| 147 void RunAnimationForWindow(aura::Window* window, |
| 148 AnimationType type, |
| 149 ui::LayerAnimationObserver* observer); |
| 150 |
| 139 // Layer that's stacked under all of the root window's children to provide a | 151 // Layer that's stacked under all of the root window's children to provide a |
| 140 // black background when we're scaling all of the other windows down. | 152 // black background when we're scaling all of the other windows down. |
| 141 // TODO(derat): Remove this in favor of having the compositor only clear the | 153 // TODO(derat): Remove this in favor of having the compositor only clear the |
| 142 // viewport when there are regions not covered by a layer: | 154 // viewport when there are regions not covered by a layer: |
| 143 // http://crbug.com/113445 | 155 // http://crbug.com/113445 |
| 144 scoped_ptr<ui::Layer> black_layer_; | 156 scoped_ptr<ui::Layer> black_layer_; |
| 145 | 157 |
| 146 // White foreground that is used during shutdown animation to "fade | 158 // White foreground that is used during shutdown animation to "fade |
| 147 // everything into white". | 159 // everything into white". |
| 148 scoped_ptr<ColoredWindowController> foreground_; | 160 scoped_ptr<ColoredWindowController> foreground_; |
| 149 | 161 |
| 150 // Started when we abort the pre-lock state. When it fires, we hide | 162 // Started when we abort the pre-lock state. When it fires, we hide |
| 151 // |black_layer_|, as the desktop background is now covering the whole | 163 // |black_layer_|, as the desktop background is now covering the whole |
| 152 // screen. | 164 // screen. |
| 153 base::OneShotTimer<SessionStateAnimator> hide_black_layer_timer_; | 165 base::OneShotTimer<SessionStateAnimator> hide_black_layer_timer_; |
| 154 | 166 |
| 155 DISALLOW_COPY_AND_ASSIGN(SessionStateAnimator); | 167 DISALLOW_COPY_AND_ASSIGN(SessionStateAnimator); |
| 156 }; | 168 }; |
| 157 | 169 |
| 158 } // namespace internal | 170 } // namespace internal |
| 159 } // namespace ash | 171 } // namespace ash |
| 160 | 172 |
| 161 #endif // ASH_WM_SESSION_STATE_ANIMATOR_H_ | 173 #endif // ASH_WM_SESSION_STATE_ANIMATOR_H_ |
| OLD | NEW |