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_WINDOW_ANIMATIONS_H_ | 5 #ifndef ASH_WM_WINDOW_ANIMATIONS_H_ |
6 #define ASH_WM_WINDOW_ANIMATIONS_H_ | 6 #define ASH_WM_WINDOW_ANIMATIONS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "base/time.h" |
10 | 11 |
11 namespace aura { | 12 namespace aura { |
12 class Window; | 13 class Window; |
13 } | 14 } |
14 | 15 |
15 namespace ash { | 16 namespace ash { |
16 | 17 |
17 // A variety of canned animations for window transitions. | 18 // A variety of canned animations for window transitions. |
18 enum WindowVisibilityAnimationType { | 19 enum WindowVisibilityAnimationType { |
19 WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT = 0, // Default. Lets the system | 20 WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT = 0, // Default. Lets the system |
20 // decide based on window type. | 21 // decide based on window type. |
21 WINDOW_VISIBILITY_ANIMATION_TYPE_DROP, // Window shrinks in. | 22 WINDOW_VISIBILITY_ANIMATION_TYPE_DROP, // Window shrinks in. |
22 WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL, // Vertical Glenimation. | 23 WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL, // Vertical Glenimation. |
23 WINDOW_VISIBILITY_ANIMATION_TYPE_FADE // Fades in/out. | 24 WINDOW_VISIBILITY_ANIMATION_TYPE_FADE // Fades in/out. |
24 }; | 25 }; |
25 | 26 |
| 27 // Type of visibility change transition that a window should animate. |
| 28 // Default behavior is to animate both show and hide. |
| 29 enum WindowVisibilityAnimationTransition { |
| 30 // 0 is used as default. |
| 31 ANIMATE_SHOW = 0x1, |
| 32 ANIMATE_HIDE = 0x2, |
| 33 ANIMATE_BOTH = ANIMATE_SHOW | ANIMATE_HIDE, |
| 34 ANIMATE_NONE = 0x4, |
| 35 }; |
| 36 |
26 void ASH_EXPORT SetWindowVisibilityAnimationType( | 37 void ASH_EXPORT SetWindowVisibilityAnimationType( |
27 aura::Window* window, | 38 aura::Window* window, |
28 WindowVisibilityAnimationType type); | 39 WindowVisibilityAnimationType type); |
29 | 40 |
| 41 void ASH_EXPORT SetWindowVisibilityAnimationTransition( |
| 42 aura::Window* window, |
| 43 WindowVisibilityAnimationTransition transition); |
| 44 |
| 45 void ASH_EXPORT SetWindowVisibilityAnimationDuration( |
| 46 aura::Window* window, |
| 47 const base::TimeDelta& duration); |
| 48 |
30 namespace internal { | 49 namespace internal { |
31 | 50 |
32 void AnimateOnChildWindowVisibilityChanged(aura::Window* window, bool visible); | 51 // Returns false if the |window| didn't animate. |
| 52 bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, bool visible); |
33 | 53 |
34 } // namespace internal | 54 } // namespace internal |
35 } // namespace ash | 55 } // namespace ash |
36 | 56 |
37 | 57 |
38 #endif // ASH_WM_WINDOW_ANIMATIONS_H_ | 58 #endif // ASH_WM_WINDOW_ANIMATIONS_H_ |
OLD | NEW |