Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef ASH_WM_WM_TYPES_H_ |
| 6 | #define ASH_WM_WM_TYPES_H_ |
| 7 | |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 8 | #include "ash/ash_export.h" |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 9 | #include "ui/base/ui_base_types.h" |
| 10 | |
| 11 | namespace ash { |
| 12 | namespace wm { |
| 13 | |
| 14 | // This enum defines both common show state copied from |
| 15 | // ui::WindowShowState as well as new states intoruduced in ash. |
| 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 |
| 18 | // that they'll persist over time. |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 19 | enum WindowStateType { |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 20 | // Common state |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 21 | WINDOW_STATE_TYPE_DEFAULT = 0, |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 22 | |
| 23 | // Normal represents a state where the position/size has been |
| 24 | // specified by a use. |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 25 | WINDOW_STATE_TYPE_NORMAL, |
| 26 | WINDOW_STATE_TYPE_MINIMIZED, |
| 27 | WINDOW_STATE_TYPE_MAXIMIZED, |
| 28 | WINDOW_STATE_TYPE_INACTIVE, |
| 29 | WINDOW_STATE_TYPE_FULLSCREEN, |
| 30 | WINDOW_STATE_TYPE_DETACHED, |
| 31 | WINDOW_STATE_TYPE_END, // to avoid using SHOW_STATE_END |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 32 | |
| 33 | // Ash specific states: |
| 34 | |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 35 | WINDOW_STATE_TYPE_LEFT_SNAPPED, |
| 36 | WINDOW_STATE_TYPE_RIGHT_SNAPPED, |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 37 | |
| 38 | // A window is in this state when it is automatically placed and |
| 39 | // sized by the window manager. (it's newly opened, or pushed to the side |
| 40 | // due to new window, for example). |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 41 | WINDOW_STATE_TYPE_AUTO_POSITIONED, |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 42 | }; |
| 43 | |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 44 | // Utility functions to convert WindowStateType <-> ui::WindowShowState. |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 45 | // Note: LEFT/RIGHT MAXIMIZED, AUTO_POSITIONED type will be lost when |
| 46 | // converting to ui::WindowShowState. |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 47 | ASH_EXPORT WindowStateType ToWindowStateType(ui::WindowShowState state); |
| 48 | ASH_EXPORT ui::WindowShowState ToWindowShowState(WindowStateType type); |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 49 | |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 50 | // Returns true if |type| is WINDOW_STATE_TYPE_MAXIMIZED or |
| 51 | // WINDOW_STATE_TYPE_FULLSCREEN. |
| 52 | ASH_EXPORT bool IsMaximizedOrFullscreenWindowStateType(WindowStateType type); |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 53 | |
| 54 | } // namespace wm |
| 55 | } // namespace ash |
Torne (Richard Coles) | 4e180b6 | 2013-10-18 15:46:22 +0100 | [diff] [blame] | 56 | |
| 57 | #endif // ASH_WM_WM_TYPES_H_ |