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" | |
10 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
12 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
13 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
14 #include "ui/compositor/layer_animation_observer.h" | 13 #include "ui/compositor/layer_animation_observer.h" |
15 | 14 |
16 namespace gfx { | 15 namespace gfx { |
17 class Rect; | 16 class Rect; |
18 class Size; | 17 class Size; |
19 } | 18 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 SessionStateAnimator(); | 132 SessionStateAnimator(); |
134 virtual ~SessionStateAnimator(); | 133 virtual ~SessionStateAnimator(); |
135 | 134 |
136 // Reports animation duration for |speed|. | 135 // Reports animation duration for |speed|. |
137 static base::TimeDelta GetDuration(AnimationSpeed speed); | 136 static base::TimeDelta GetDuration(AnimationSpeed speed); |
138 | 137 |
139 // Fills |containers| with the containers included in |container_mask|. | 138 // Fills |containers| with the containers included in |container_mask|. |
140 static void GetContainers(int container_mask, | 139 static void GetContainers(int container_mask, |
141 aura::Window::Windows* containers); | 140 aura::Window::Windows* containers); |
142 | 141 |
143 // Create |foreground_| layer if it doesn't already exist, but makes it | |
144 // completely transparent. | |
145 void CreateForeground(); | |
146 // Destroy |foreground_| when it is not needed anymore. | |
147 void DropForeground(); | |
148 | |
149 // Apply animation |type| to all containers included in |container_mask| with | 142 // Apply animation |type| to all containers included in |container_mask| with |
150 // specified |speed|. | 143 // specified |speed|. |
151 void StartAnimation(int container_mask, | 144 void StartAnimation(int container_mask, |
152 AnimationType type, | 145 AnimationType type, |
153 AnimationSpeed speed); | 146 AnimationSpeed speed); |
154 | 147 |
155 // Apply animation |type| to all containers included in |container_mask| with | 148 // Apply animation |type| to all containers included in |container_mask| with |
156 // specified |speed| and call a |callback| at the end of the animation, if it | 149 // specified |speed| and call a |callback| at the end of the animation, if it |
157 // is not null. | 150 // is not null. |
158 void StartAnimationWithCallback(int container_mask, | 151 void StartAnimationWithCallback(int container_mask, |
(...skipping 12 matching lines...) Expand all Loading... |
171 void StartGlobalAnimation(AnimationType type, | 164 void StartGlobalAnimation(AnimationType type, |
172 AnimationSpeed speed); | 165 AnimationSpeed speed); |
173 | 166 |
174 // Apply animation |type| to window |window| with |speed| and add |observer| | 167 // Apply animation |type| to window |window| with |speed| and add |observer| |
175 // if it is not NULL to the last animation sequence. | 168 // if it is not NULL to the last animation sequence. |
176 void RunAnimationForWindow(aura::Window* window, | 169 void RunAnimationForWindow(aura::Window* window, |
177 AnimationType type, | 170 AnimationType type, |
178 AnimationSpeed speed, | 171 AnimationSpeed speed, |
179 ui::LayerAnimationObserver* observer); | 172 ui::LayerAnimationObserver* observer); |
180 | 173 |
181 // White foreground that is used during shutdown animation to "fade | |
182 // everything into white". | |
183 scoped_ptr<ColoredWindowController> foreground_; | |
184 | |
185 DISALLOW_COPY_AND_ASSIGN(SessionStateAnimator); | 174 DISALLOW_COPY_AND_ASSIGN(SessionStateAnimator); |
186 }; | 175 }; |
187 | 176 |
188 } // namespace internal | 177 } // namespace internal |
189 } // namespace ash | 178 } // namespace ash |
190 | 179 |
191 #endif // ASH_WM_SESSION_STATE_ANIMATOR_H_ | 180 #endif // ASH_WM_SESSION_STATE_ANIMATOR_H_ |
OLD | NEW |