OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_WM_WM_TYPES_H_ | 5 #ifndef ASH_COMMON_WM_WM_TYPES_H_ |
6 #define ASH_COMMON_WM_WM_TYPES_H_ | 6 #define ASH_COMMON_WM_WM_TYPES_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ui/base/ui_base_types.h" | 9 #include "ui/base/ui_base_types.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 namespace wm { | 12 namespace wm { |
13 | 13 |
14 // This enum defines both common show state copied from | 14 // This enum defines both common show state copied from |
15 // ui::WindowShowState as well as new states introduced in ash. | 15 // ui::WindowShowState as well as new states introduced in ash. |
16 // The separate enum is defined here because we don't want to leak | 16 // The separate enum is defined here because we don't want to leak |
17 // these type to ui/base until they're stable and we know for sure | 17 // these type to ui/base until they're stable and we know for sure |
18 // that they'll persist over time. | 18 // that they'll persist over time. |
19 enum WindowStateType { | 19 enum WindowStateType { |
20 // Common state | 20 // Common state |
21 WINDOW_STATE_TYPE_DEFAULT = 0, | 21 WINDOW_STATE_TYPE_DEFAULT = 0, |
22 | 22 |
23 // Normal represents a state where the position/size has been | 23 // Normal represents a state where the position/size has been |
24 // specified by a use. | 24 // specified by a use. |
25 WINDOW_STATE_TYPE_NORMAL, | 25 WINDOW_STATE_TYPE_NORMAL, |
26 WINDOW_STATE_TYPE_MINIMIZED, | 26 WINDOW_STATE_TYPE_MINIMIZED, |
27 WINDOW_STATE_TYPE_MAXIMIZED, | 27 WINDOW_STATE_TYPE_MAXIMIZED, |
28 WINDOW_STATE_TYPE_INACTIVE, | 28 WINDOW_STATE_TYPE_INACTIVE, |
29 WINDOW_STATE_TYPE_FULLSCREEN, | 29 WINDOW_STATE_TYPE_FULLSCREEN, |
30 WINDOW_STATE_TYPE_DOCKED, | |
31 WINDOW_STATE_TYPE_END, // to avoid using SHOW_STATE_END | 30 WINDOW_STATE_TYPE_END, // to avoid using SHOW_STATE_END |
32 | 31 |
33 // Ash specific states: | 32 // Ash specific states: |
34 | 33 |
35 WINDOW_STATE_TYPE_LEFT_SNAPPED, | 34 WINDOW_STATE_TYPE_LEFT_SNAPPED, |
36 WINDOW_STATE_TYPE_RIGHT_SNAPPED, | 35 WINDOW_STATE_TYPE_RIGHT_SNAPPED, |
37 | 36 |
38 WINDOW_STATE_TYPE_DOCKED_MINIMIZED, | |
39 | |
40 // A window is in this state when it is automatically placed and | 37 // A window is in this state when it is automatically placed and |
41 // sized by the window manager. (it's newly opened, or pushed to the side | 38 // sized by the window manager. (it's newly opened, or pushed to the side |
42 // due to new window, for example). | 39 // due to new window, for example). |
43 WINDOW_STATE_TYPE_AUTO_POSITIONED, | 40 WINDOW_STATE_TYPE_AUTO_POSITIONED, |
44 | 41 |
45 // A window is pinned on top of other windows with fullscreenized. | 42 // A window is pinned on top of other windows with fullscreenized. |
46 // Corresponding shelf should be hidden, also most of windows other than the | 43 // Corresponding shelf should be hidden, also most of windows other than the |
47 // pinned one should be hidden. | 44 // pinned one should be hidden. |
48 WINDOW_STATE_TYPE_PINNED, | 45 WINDOW_STATE_TYPE_PINNED, |
49 WINDOW_STATE_TYPE_TRUSTED_PINNED, | 46 WINDOW_STATE_TYPE_TRUSTED_PINNED, |
50 }; | 47 }; |
51 | 48 |
52 // Utility functions to convert WindowStateType <-> ui::WindowShowState. | 49 // Utility functions to convert WindowStateType <-> ui::WindowShowState. |
53 // Note: LEFT/RIGHT MAXIMIZED, AUTO_POSITIONED type will be lost when | 50 // Note: LEFT/RIGHT MAXIMIZED, AUTO_POSITIONED type will be lost when |
54 // converting to ui::WindowShowState. | 51 // converting to ui::WindowShowState. |
55 ASH_EXPORT WindowStateType ToWindowStateType(ui::WindowShowState state); | 52 ASH_EXPORT WindowStateType ToWindowStateType(ui::WindowShowState state); |
56 ASH_EXPORT ui::WindowShowState ToWindowShowState(WindowStateType type); | 53 ASH_EXPORT ui::WindowShowState ToWindowShowState(WindowStateType type); |
57 | 54 |
58 // Returns true if |type| is WINDOW_STATE_TYPE_MAXIMIZED, | 55 // Returns true if |type| is WINDOW_STATE_TYPE_MAXIMIZED, |
59 // WINDOW_STATE_TYPE_FULLSCREEN or WINDOW_STATE_TYPE_PINNED. | 56 // WINDOW_STATE_TYPE_FULLSCREEN or WINDOW_STATE_TYPE_PINNED. |
60 ASH_EXPORT bool IsMaximizedOrFullscreenOrPinnedWindowStateType( | 57 ASH_EXPORT bool IsMaximizedOrFullscreenOrPinnedWindowStateType( |
61 WindowStateType type); | 58 WindowStateType type); |
62 | 59 |
63 } // namespace wm | 60 } // namespace wm |
64 } // namespace ash | 61 } // namespace ash |
65 | 62 |
66 #endif // ASH_COMMON_WM_WM_TYPES_H_ | 63 #endif // ASH_COMMON_WM_WM_TYPES_H_ |
OLD | NEW |