Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: ash/wm/window_animations.h

Issue 2243513004: mash: Partially migrate WorkspaceController to ash common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ui/gfx/animation/tween.h" 11 #include "ui/gfx/animation/tween.h"
12 #include "ui/gfx/transform.h"
13 #include "ui/wm/core/window_animations.h" 12 #include "ui/wm/core/window_animations.h"
14 13
15 namespace aura { 14 namespace aura {
16 class Window; 15 class Window;
17 } 16 }
18 17
19 namespace ui { 18 namespace ui {
20 class Layer;
21 class LayerTreeOwner; 19 class LayerTreeOwner;
22 } 20 }
23 21
24 // This is only for animations specific to Ash. For window animations shared 22 // This is only for animations specific to Ash. For window animations shared
25 // with desktop Chrome, see ui/views/corewm/window_animations.h. 23 // with desktop Chrome, see ui/views/corewm/window_animations.h.
26 namespace ash { 24 namespace ash {
27 25
28 // Direction for ash-specific window animations used in workspaces and
29 // lock/unlock animations.
30 enum LayerScaleAnimationDirection {
31 LAYER_SCALE_ANIMATION_ABOVE,
32 LAYER_SCALE_ANIMATION_BELOW,
33 };
34
35 // Amount of time for the cross fade animation. 26 // Amount of time for the cross fade animation.
36 extern const int kCrossFadeDurationMS; 27 extern const int kCrossFadeDurationMS;
37 28
38 // Implementation of cross fading. Window is the window being cross faded. It 29 // Implementation of cross fading. Window is the window being cross faded. It
39 // should be at the target bounds. |old_layer_owner| contains the previous layer 30 // should be at the target bounds. |old_layer_owner| contains the previous layer
40 // from |window|. |tween_type| specifies the tween type of the cross fade 31 // from |window|. |tween_type| specifies the tween type of the cross fade
41 // animation. 32 // animation.
42 ASH_EXPORT base::TimeDelta CrossFadeAnimation( 33 ASH_EXPORT base::TimeDelta CrossFadeAnimation(
43 aura::Window* window, 34 aura::Window* window,
44 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner, 35 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner,
45 gfx::Tween::Type tween_type); 36 gfx::Tween::Type tween_type);
46 37
47 ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, 38 ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window,
48 bool visible); 39 bool visible);
49 40
50 // Creates vector of animation sequences that lasts for |duration| and changes 41 // Creates vector of animation sequences that lasts for |duration| and changes
51 // brightness and grayscale to |target_value|. Caller takes ownership of 42 // brightness and grayscale to |target_value|. Caller takes ownership of
52 // returned LayerAnimationSequence objects. 43 // returned LayerAnimationSequence objects.
53 ASH_EXPORT std::vector<ui::LayerAnimationSequence*> 44 ASH_EXPORT std::vector<ui::LayerAnimationSequence*>
54 CreateBrightnessGrayscaleAnimationSequence(float target_value, 45 CreateBrightnessGrayscaleAnimationSequence(float target_value,
55 base::TimeDelta duration); 46 base::TimeDelta duration);
56 47
57 // Applies scale related to the specified AshWindowScaleType.
58 ASH_EXPORT void SetTransformForScaleAnimation(
59 ui::Layer* layer,
60 LayerScaleAnimationDirection type);
61
62 // Returns the approximate bounds to which |window| will be animated when it 48 // Returns the approximate bounds to which |window| will be animated when it
63 // is minimized. The bounds are approximate because the minimize animation 49 // is minimized. The bounds are approximate because the minimize animation
64 // involves rotation. 50 // involves rotation.
65 ASH_EXPORT gfx::Rect GetMinimizeAnimationTargetBoundsInScreen( 51 ASH_EXPORT gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(
66 aura::Window* window); 52 aura::Window* window);
67 53
68 } // namespace ash 54 } // namespace ash
69 55
70 #endif // ASH_WM_WINDOW_ANIMATIONS_H_ 56 #endif // ASH_WM_WINDOW_ANIMATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698