Only fsync leveldb's directory when the manifest is being updated.
[chromium-blink-merge.git] / ash / wm / window_animations.h
blob3f28b233021fceeeecb519671e96e8eca1d6d213
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/transform.h"
10 #include "ui/views/corewm/window_animations.h"
12 namespace aura {
13 class Window;
15 namespace ui {
16 class Layer;
19 // This is only for animations specific to Ash. For window animations shared
20 // with desktop Chrome, see ui/views/corewm/window_animations.h.
21 namespace ash {
23 // An extension of the window animations provided by CoreWm. These should be
24 // Ash-specific only.
25 enum WindowVisibilityAnimationType {
26 // Window scale/rotates down to its launcher icon.
27 WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE =
28 views::corewm::WINDOW_VISIBILITY_ANIMATION_MAX,
29 // Fade in/out using brightness and grayscale web filters.
30 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE
33 // Direction for ash-specific window animations used in workspaces and
34 // lock/unlock animations.
35 enum LayerScaleAnimationDirection {
36 LAYER_SCALE_ANIMATION_ABOVE,
37 LAYER_SCALE_ANIMATION_BELOW,
40 // Animate a cross-fade of |window| from its current bounds to |new_bounds|.
41 ASH_EXPORT void CrossFadeToBounds(aura::Window* window,
42 const gfx::Rect& new_bounds);
44 // Cross fades |layer| (which is a clone of |window|s layer before it was
45 // resized) to |window|s current bounds. |new_workspace| is the Window of the
46 // workspace |window| was added to.
47 // This takes ownership of |layer|.
48 ASH_EXPORT void CrossFadeWindowBetweenWorkspaces(aura::Window* new_workspace,
49 aura::Window* window,
50 ui::Layer* layer);
52 // Returns the duration of the cross-fade animation based on the |old_bounds|
53 // and |new_bounds| of the window.
54 ASH_EXPORT base::TimeDelta GetCrossFadeDuration(const gfx::Rect& old_bounds,
55 const gfx::Rect& new_bounds);
57 ASH_EXPORT bool AnimateOnChildWindowVisibilityChanged(aura::Window* window,
58 bool visible);
60 // Creates vector of animation sequences that lasts for |duration| and changes
61 // brightness and grayscale to |target_value|. Caller takes ownership of
62 // returned LayerAnimationSequence objects.
63 ASH_EXPORT std::vector<ui::LayerAnimationSequence*>
64 CreateBrightnessGrayscaleAnimationSequence(float target_value,
65 base::TimeDelta duration);
67 // Applies scale related to the specified AshWindowScaleType.
68 ASH_EXPORT void SetTransformForScaleAnimation(
69 ui::Layer* layer,
70 LayerScaleAnimationDirection type);
72 } // namespace ash
75 #endif // ASH_WM_WINDOW_ANIMATIONS_H_