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
3 // found in the LICENSE file.
5 #ifndef ASH_WM_WINDOW_ANIMATIONS_H_
6 #define ASH_WM_WINDOW_ANIMATIONS_H_
8 #include "ash/ash_export.h"
9 #include "ui/gfx/animation/tween.h"
10 #include "ui/gfx/transform.h"
11 #include "ui/views/corewm/window_animations.h"
20 // This is only for animations specific to Ash. For window animations shared
21 // with desktop Chrome, see ui/views/corewm/window_animations.h.
24 // An extension of the window animations provided by CoreWm. These should be
26 enum WindowVisibilityAnimationType
{
27 // Window scale/rotates down to its launcher icon.
28 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE
=
29 views::corewm::WINDOW_VISIBILITY_ANIMATION_MAX
,
30 // Fade in/out using brightness and grayscale web filters.
31 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE
34 // Direction for ash-specific window animations used in workspaces and
35 // lock/unlock animations.
36 enum LayerScaleAnimationDirection
{
37 LAYER_SCALE_ANIMATION_ABOVE
,
38 LAYER_SCALE_ANIMATION_BELOW
,
41 // Amount of time for the cross fade animation.
42 extern const int kCrossFadeDurationMS
;
44 // Implementation of cross fading. Window is the window being cross faded. It
45 // should be at the target bounds. |old_layer| the previous layer from |window|.
46 // This takes ownership of |old_layer| and deletes when the animation is done.
47 // |tween_type| specifies the tween type of the cross fade animation.
48 ASH_EXPORT
base::TimeDelta
CrossFadeAnimation(aura::Window
* window
,
50 gfx::Tween::Type tween_type
);
52 ASH_EXPORT
bool AnimateOnChildWindowVisibilityChanged(aura::Window
* window
,
55 // Creates vector of animation sequences that lasts for |duration| and changes
56 // brightness and grayscale to |target_value|. Caller takes ownership of
57 // returned LayerAnimationSequence objects.
58 ASH_EXPORT
std::vector
<ui::LayerAnimationSequence
*>
59 CreateBrightnessGrayscaleAnimationSequence(float target_value
,
60 base::TimeDelta duration
);
62 // Applies scale related to the specified AshWindowScaleType.
63 ASH_EXPORT
void SetTransformForScaleAnimation(
65 LayerScaleAnimationDirection type
);
67 // Returns the approximate bounds to which |window| will be animated when it
68 // is minimized. The bounds are approximate because the minimize animation
70 ASH_EXPORT
gfx::Rect
GetMinimizeAnimationTargetBoundsInScreen(
71 aura::Window
* window
);
75 #endif // ASH_WM_WINDOW_ANIMATIONS_H_