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 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 | 9 |
10 namespace aura { | 10 namespace aura { |
(...skipping 25 matching lines...) Expand all Loading... |
36 WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_HIDE, // Inverse of SHOW. | 36 WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_HIDE, // Inverse of SHOW. |
37 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE, // Window scale/rotates down | 37 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE, // Window scale/rotates down |
38 // to its launcher icon. | 38 // to its launcher icon. |
39 // Fade in/out using brightness and grayscale web filters. | 39 // Fade in/out using brightness and grayscale web filters. |
40 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE, | 40 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE, |
41 }; | 41 }; |
42 | 42 |
43 // Type of visibility change transition that a window should animate. | 43 // Type of visibility change transition that a window should animate. |
44 // Default behavior is to animate both show and hide. | 44 // Default behavior is to animate both show and hide. |
45 enum WindowVisibilityAnimationTransition { | 45 enum WindowVisibilityAnimationTransition { |
46 // 0 is used as default. | |
47 ANIMATE_SHOW = 0x1, | 46 ANIMATE_SHOW = 0x1, |
48 ANIMATE_HIDE = 0x2, | 47 ANIMATE_HIDE = 0x2, |
49 ANIMATE_BOTH = ANIMATE_SHOW | ANIMATE_HIDE, | 48 ANIMATE_BOTH = ANIMATE_SHOW | ANIMATE_HIDE, |
50 ANIMATE_NONE = 0x4, | 49 ANIMATE_NONE = 0x4, |
51 }; | 50 }; |
52 | 51 |
53 ASH_EXPORT void SetWindowVisibilityAnimationType( | 52 ASH_EXPORT void SetWindowVisibilityAnimationType( |
54 aura::Window* window, | 53 aura::Window* window, |
55 WindowVisibilityAnimationType type); | 54 WindowVisibilityAnimationType type); |
56 | 55 |
(...skipping 16 matching lines...) Expand all Loading... |
73 // associated with a Window so that the animation can continue after the Window | 72 // associated with a Window so that the animation can continue after the Window |
74 // has been destroyed. | 73 // has been destroyed. |
75 // The returned object deletes itself when the animations are done. | 74 // The returned object deletes itself when the animations are done. |
76 ASH_EXPORT ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( | 75 ASH_EXPORT ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( |
77 aura::Window* window); | 76 aura::Window* window); |
78 | 77 |
79 // Animate a cross-fade of |window| from its current bounds to |new_bounds|. | 78 // Animate a cross-fade of |window| from its current bounds to |new_bounds|. |
80 ASH_EXPORT void CrossFadeToBounds(aura::Window* window, | 79 ASH_EXPORT void CrossFadeToBounds(aura::Window* window, |
81 const gfx::Rect& new_bounds); | 80 const gfx::Rect& new_bounds); |
82 | 81 |
83 // Cross fade |layer| (which is a clone of |window|s layer before it was | 82 // Cross fades |layer| (which is a clone of |window|s layer before it was |
84 // resized) to windows current bounds. |new_workspace| is the original workspace | 83 // resized) to |window|s current bounds. |new_workspace| is the Window of the |
85 // |window| was in and |new_workspace| the new workspace. | 84 // workspace |window| was added to. |
86 // This takes ownership of |layer|. | 85 // This takes ownership of |layer|. |
87 ASH_EXPORT void CrossFadeWindowBetweenWorkspaces(aura::Window* old_workspace, | 86 ASH_EXPORT void CrossFadeWindowBetweenWorkspaces(aura::Window* new_workspace, |
88 aura::Window* new_workspace, | |
89 aura::Window* window, | 87 aura::Window* window, |
90 ui::Layer* layer); | 88 ui::Layer* layer); |
91 | 89 |
92 // Indicates the direction the workspace should appear to go. | |
93 enum WorkspaceAnimationDirection { | |
94 WORKSPACE_ANIMATE_UP, | |
95 WORKSPACE_ANIMATE_DOWN, | |
96 }; | |
97 | |
98 enum WorkspaceType { | |
99 WORKSPACE_MAXIMIZED, | |
100 WORKSPACE_DESKTOP, | |
101 }; | |
102 | |
103 // Amount of time for the workspace switch animation. | |
104 extern const int kWorkspaceSwitchTimeMS; | |
105 | |
106 // Animates between two workspaces. If |animate_old| is false |old_window| is | |
107 // not animated, otherwise it is. |is_restoring_maximized_window| is true if | |
108 // the switch is the result of a minmized window being restored. | |
109 ASH_EXPORT void AnimateBetweenWorkspaces(aura::Window* old_window, | |
110 WorkspaceType old_type, | |
111 bool animate_old, | |
112 aura::Window* new_window, | |
113 WorkspaceType new_type, | |
114 bool is_restoring_maximized_window); | |
115 | |
116 // Animates the workspace visualy in or out. This is used when the workspace is | |
117 // becoming active, and out when the workspace was active. If |initial_animate| | |
118 // is true, this animation is the result of logging in. | |
119 ASH_EXPORT void AnimateWorkspaceIn(aura::Window* window, | |
120 WorkspaceAnimationDirection direction, | |
121 bool initial_animate, | |
122 base::TimeDelta delta); | |
123 ASH_EXPORT void AnimateWorkspaceOut(aura::Window* window, | |
124 WorkspaceAnimationDirection direction, | |
125 WorkspaceType type, | |
126 bool initial_animate, | |
127 base::TimeDelta delta); | |
128 | |
129 // Returns the amount of time before destroying the system background. | |
130 ASH_EXPORT base::TimeDelta GetSystemBackgroundDestroyDuration(); | |
131 | |
132 // Returns the duration of the cross-fade animation based on the |old_bounds| | 90 // Returns the duration of the cross-fade animation based on the |old_bounds| |
133 // and |new_bounds| of the window. | 91 // and |new_bounds| of the window. |
134 ASH_EXPORT base::TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds, | 92 ASH_EXPORT base::TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds, |
135 const gfx::Rect& new_bounds); | 93 const gfx::Rect& new_bounds); |
136 | 94 |
137 namespace internal { | 95 namespace internal { |
138 | 96 |
139 // Returns false if the |window| didn't animate. | 97 // Returns false if the |window| didn't animate. |
140 ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged( | 98 ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, |
141 aura::Window* window, bool visible); | 99 bool visible); |
142 | 100 |
143 } // namespace internal | 101 } // namespace internal |
144 } // namespace ash | 102 } // namespace ash |
145 | 103 |
146 | 104 |
147 #endif // ASH_WM_WINDOW_ANIMATIONS_H_ | 105 #endif // ASH_WM_WINDOW_ANIMATIONS_H_ |
OLD | NEW |