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.
5 #include "ash/wm/wm_types.h"
7 #include "base/basictypes.h"
8 #include "base/logging.h"
13 // This is to catch the change to WindowShowState.
14 static_assert(ui::SHOW_STATE_END
==
15 static_cast<ui::WindowShowState
>(WINDOW_STATE_TYPE_END
),
16 "show enum mismatch");
18 WindowStateType
ToWindowStateType(ui::WindowShowState state
) {
19 return static_cast<WindowStateType
>(state
);
22 ui::WindowShowState
ToWindowShowState(WindowStateType type
) {
24 case WINDOW_STATE_TYPE_DEFAULT
:
25 return ui::SHOW_STATE_DEFAULT
;
26 case WINDOW_STATE_TYPE_NORMAL
:
27 case WINDOW_STATE_TYPE_RIGHT_SNAPPED
:
28 case WINDOW_STATE_TYPE_LEFT_SNAPPED
:
29 case WINDOW_STATE_TYPE_AUTO_POSITIONED
:
30 case WINDOW_STATE_TYPE_DOCKED
:
31 return ui::SHOW_STATE_NORMAL
;
32 case WINDOW_STATE_TYPE_MINIMIZED
:
33 case WINDOW_STATE_TYPE_DOCKED_MINIMIZED
:
34 return ui::SHOW_STATE_MINIMIZED
;
35 case WINDOW_STATE_TYPE_MAXIMIZED
:
36 return ui::SHOW_STATE_MAXIMIZED
;
37 case WINDOW_STATE_TYPE_INACTIVE
:
38 return ui::SHOW_STATE_INACTIVE
;
39 case WINDOW_STATE_TYPE_FULLSCREEN
:
40 return ui::SHOW_STATE_FULLSCREEN
;
41 case WINDOW_STATE_TYPE_END
:
45 return ui::SHOW_STATE_DEFAULT
;
48 bool IsMaximizedOrFullscreenWindowStateType(WindowStateType type
) {
49 return type
== WINDOW_STATE_TYPE_MAXIMIZED
||
50 type
== WINDOW_STATE_TYPE_FULLSCREEN
;