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 #include "ui/gfx/transform.h" | |
9 #include "ui/views/corewm/window_animations.h" | 10 #include "ui/views/corewm/window_animations.h" |
10 | 11 |
11 namespace aura { | 12 namespace aura { |
12 class Window; | 13 class Window; |
13 } | 14 } |
14 namespace ui { | 15 namespace ui { |
15 class Layer; | 16 class Layer; |
16 } | 17 } |
17 | 18 |
18 // This is only for animations specific to Ash. For window animations shared | 19 // This is only for animations specific to Ash. For window animations shared |
19 // with desktop Chrome, see ui/views/corewm/window_animations.h. | 20 // with desktop Chrome, see ui/views/corewm/window_animations.h. |
20 namespace ash { | 21 namespace ash { |
21 | 22 |
22 // An extension of the window animations provided by CoreWm. These should be | 23 // An extension of the window animations provided by CoreWm. These should be |
23 // Ash-specific only. | 24 // Ash-specific only. |
24 enum WindowVisibilityAnimationType { | 25 enum WindowVisibilityAnimationType { |
25 // Window scale/rotates down to its launcher icon. | 26 // Window scale/rotates down to its launcher icon. |
26 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE = | 27 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE = |
27 views::corewm::WINDOW_VISIBILITY_ANIMATION_MAX, | 28 views::corewm::WINDOW_VISIBILITY_ANIMATION_MAX, |
28 // Fade in/out using brightness and grayscale web filters. | 29 // Fade in/out using brightness and grayscale web filters. |
29 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE | 30 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE |
30 }; | 31 }; |
31 | 32 |
33 // Direction Ash-specific window animations used in workspaces and lock/unlock | |
Daniel Erat
2012/11/30 14:33:08
nit: s/Direction/Direction for/
| |
34 // animations. | |
35 enum AshWindowScaleType { | |
Daniel Erat
2012/11/30 14:33:08
LayerScaleAnimationDirection?
| |
36 ASH_WINDOW_SCALE_ABOVE, | |
Daniel Erat
2012/11/30 14:33:08
LAYER_SCALE_ANIMATION_ABOVE
| |
37 ASH_WINDOW_SCALE_BELOW, | |
38 }; | |
39 | |
32 // Animate a cross-fade of |window| from its current bounds to |new_bounds|. | 40 // Animate a cross-fade of |window| from its current bounds to |new_bounds|. |
33 ASH_EXPORT void CrossFadeToBounds(aura::Window* window, | 41 ASH_EXPORT void CrossFadeToBounds(aura::Window* window, |
34 const gfx::Rect& new_bounds); | 42 const gfx::Rect& new_bounds); |
35 | 43 |
36 // Cross fades |layer| (which is a clone of |window|s layer before it was | 44 // Cross fades |layer| (which is a clone of |window|s layer before it was |
37 // resized) to |window|s current bounds. |new_workspace| is the Window of the | 45 // resized) to |window|s current bounds. |new_workspace| is the Window of the |
38 // workspace |window| was added to. | 46 // workspace |window| was added to. |
39 // This takes ownership of |layer|. | 47 // This takes ownership of |layer|. |
40 ASH_EXPORT void CrossFadeWindowBetweenWorkspaces(aura::Window* new_workspace, | 48 ASH_EXPORT void CrossFadeWindowBetweenWorkspaces(aura::Window* new_workspace, |
41 aura::Window* window, | 49 aura::Window* window, |
42 ui::Layer* layer); | 50 ui::Layer* layer); |
43 | 51 |
44 // Returns the duration of the cross-fade animation based on the |old_bounds| | 52 // Returns the duration of the cross-fade animation based on the |old_bounds| |
45 // and |new_bounds| of the window. | 53 // and |new_bounds| of the window. |
46 ASH_EXPORT base::TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds, | 54 ASH_EXPORT base::TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds, |
47 const gfx::Rect& new_bounds); | 55 const gfx::Rect& new_bounds); |
48 | 56 |
49 ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, | 57 ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, |
50 bool visible); | 58 bool visible); |
51 | 59 |
52 // Creates vector of animation sequences that lasts for |duration| and changes | 60 // Creates vector of animation sequences that lasts for |duration| and changes |
53 // brightness and grayscale to |target_value|. Caller takes ownership of | 61 // brightness and grayscale to |target_value|. Caller takes ownership of |
54 // returned LayerAnimationSequence objects. | 62 // returned LayerAnimationSequence objects. |
55 ASH_EXPORT std::vector<ui::LayerAnimationSequence*> | 63 ASH_EXPORT std::vector<ui::LayerAnimationSequence*> |
56 CreateBrightnessGrayscaleAnimationSequence(float target_value, | 64 CreateBrightnessGrayscaleAnimationSequence(float target_value, |
57 base::TimeDelta duration); | 65 base::TimeDelta duration); |
58 | 66 |
67 // Returns scale related to the specified AshWindowScaleType. | |
Daniel Erat
2012/11/30 14:33:08
i don't understand this comment; this method retur
| |
68 ASH_EXPORT void ApplyAshWindowAnimationScale(ui::Layer* layer, | |
Daniel Erat
2012/11/30 14:33:08
SetTransformForScaleAnimation()?
("ash" seems red
| |
69 AshWindowScaleType type); | |
70 | |
59 } // namespace ash | 71 } // namespace ash |
60 | 72 |
61 | 73 |
62 #endif // ASH_WM_WINDOW_ANIMATIONS_H_ | 74 #endif // ASH_WM_WINDOW_ANIMATIONS_H_ |
OLD | NEW |