1 // Copyright 2014 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.
4 
5 #ifndef ASH_WM_OVERVIEW_OVERVIEW_TYPES_H_
6 #define ASH_WM_OVERVIEW_OVERVIEW_TYPES_H_
7 
8 namespace ash {
9 
10 // Enumeration of the different overview mode animations.
11 enum OverviewAnimationType {
12   OVERVIEW_ANIMATION_NONE,
13   // Used to fade in the close button and label.
14   OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN,
15   // Used to fade out the label.
16   OVERVIEW_ANIMATION_EXIT_OVERVIEW_MODE_FADE_OUT,
17   // Used to position windows when entering/exiting overview mode and when a
18   // window is closed while overview mode is active.
19   OVERVIEW_ANIMATION_LAYOUT_OVERVIEW_ITEMS_ON_ENTER,
20   OVERVIEW_ANIMATION_LAYOUT_OVERVIEW_ITEMS_IN_OVERVIEW,
21   OVERVIEW_ANIMATION_LAYOUT_OVERVIEW_ITEMS_ON_EXIT,
22   // Used to add an item to an active overview session using the spawn
23   // animation.
24   OVERVIEW_ANIMATION_SPAWN_ITEM_IN_OVERVIEW,
25   // Used to restore windows to their original position when exiting overview
26   // mode.
27   OVERVIEW_ANIMATION_RESTORE_WINDOW,
28   // Same as RESTORE_WINDOW but apply the target at the end of the animation.
29   OVERVIEW_ANIMATION_RESTORE_WINDOW_ZERO,
30   // Used to animate scaling down of a window that is about to get closed while
31   // overview mode is active.
32   OVERVIEW_ANIMATION_CLOSING_OVERVIEW_ITEM,
33   // Used to animate hiding of a window that is closed while overview mode is
34   // active.
35   OVERVIEW_ANIMATION_CLOSE_OVERVIEW_ITEM,
36   // Used to animate windows upon entering or exiting overview mode to or from
37   // the home launcher.
38   OVERVIEW_ANIMATION_ENTER_FROM_HOME_LAUNCHER,
39   OVERVIEW_ANIMATION_EXIT_TO_HOME_LAUNCHER,
40   // Used to fade the drop target when dragging an application.
41   OVERVIEW_ANIMATION_DROP_TARGET_FADE,
42   // Used to fade in the label which tells users they are in overview mode with
43   // no window in and out.
44   OVERVIEW_ANIMATION_NO_RECENTS_FADE,
45   // Used to fade in all windows when window drag starts or during window drag.
46   OVERVIEW_ANIMATION_OPACITY_ON_WINDOW_DRAG,
47 };
48 
49 enum class OverviewTransition {
50   kEnter,       // Entering overview.
51   kInOverview,  // Already in overview.
52   kExit         // Exiting overview.
53 };
54 
55 // Enum describing the different ways overview can be entered or exited.
56 enum class OverviewEnterExitType {
57   // The default way, window(s) animate from their initial bounds to the grid
58   // bounds. Window(s) that are not visible to the user do not get animated.
59   // This should always be the type when in clamshell mode.
60   kNormal,
61   // Used only when it's desired to enter overview mode immediately without
62   // animations. It's used when entering overview by dragging a window from
63   // the top of the screen or from the shelf, or by long pressing the overview
64   // button tray. It's also used to address https://crbug.com/1027179. This
65   // should not be used for exiting overview mode.
66   kImmediateEnter,
67   // Used only when it's desired to exit overview mode immediately without
68   // animations. This is used when performing the desk switch animation when
69   // the source desk is in overview mode, while the target desk is not.
70   // This should not be used for entering overview mode.
71   kImmediateExit,
72   // Fades all windows in to enter overview. This can happen when
73   // transitioning to overview from home screen (in a state where all windows
74   // are minimized).
75   kFadeInEnter,
76   // Fades all windows out to exit overview (when going to a state where all
77   // windows are minimized). This will minimize windows on exit if needed, so
78   // that we do not need to add a delayed observer to handle minimizing the
79   // windows after overview exit animations are finished.
80   kFadeOutExit
81 };
82 
83 // Overview items have certain properties if their aspect ratio exceeds a
84 // threshold. This enum keeps track of which category the window falls into,
85 // based on its aspect ratio.
86 enum class OverviewGridWindowFillMode {
87   // Aspect ratio is between 1:2 and 2:1.
88   kNormal,
89   // Width to height ratio exceeds 2:1. The overview item will have a 2:1
90   // aspect ratio. The window will maintain its aspect ratio and the rest of
91   // the item will be filled with a backdrop.
92   kLetterBoxed,
93   // Width to height ratio exceeds 1:2. The overview item will have a 1:2
94   // aspect ratio. The window will maintain its aspect ratio and the rest of
95   // the item will be filled with a backdrop.
96   kPillarBoxed,
97 };
98 
99 }  // namespace ash
100 
101 #endif  // ASH_WM_OVERVIEW_OVERVIEW_TYPES_H_
102