This source file includes following definitions.
- ToWindowStateType
- ToWindowShowState
- IsMaximizedOrFullscreenWindowStateType
#include "ash/wm/wm_types.h"
#include "base/basictypes.h"
#include "base/logging.h"
namespace ash {
namespace wm {
COMPILE_ASSERT(
ui::SHOW_STATE_END ==
static_cast<ui::WindowShowState>(WINDOW_STATE_TYPE_END),
show_enum_mismatch);
WindowStateType ToWindowStateType(ui::WindowShowState state) {
return static_cast<WindowStateType>(state);
}
ui::WindowShowState ToWindowShowState(WindowStateType type) {
switch (type) {
case WINDOW_STATE_TYPE_DEFAULT:
return ui::SHOW_STATE_DEFAULT;
case WINDOW_STATE_TYPE_NORMAL:
case WINDOW_STATE_TYPE_RIGHT_SNAPPED:
case WINDOW_STATE_TYPE_LEFT_SNAPPED:
case WINDOW_STATE_TYPE_AUTO_POSITIONED:
return ui::SHOW_STATE_NORMAL;
case WINDOW_STATE_TYPE_MINIMIZED:
return ui::SHOW_STATE_MINIMIZED;
case WINDOW_STATE_TYPE_MAXIMIZED:
return ui::SHOW_STATE_MAXIMIZED;
case WINDOW_STATE_TYPE_INACTIVE:
return ui::SHOW_STATE_INACTIVE;
case WINDOW_STATE_TYPE_FULLSCREEN:
return ui::SHOW_STATE_FULLSCREEN;
case WINDOW_STATE_TYPE_DETACHED:
return ui::SHOW_STATE_DETACHED;
case WINDOW_STATE_TYPE_END:
NOTREACHED();
}
NOTREACHED();
return ui::SHOW_STATE_DEFAULT;
}
bool IsMaximizedOrFullscreenWindowStateType(WindowStateType type) {
return type == WINDOW_STATE_TYPE_MAXIMIZED ||
type == WINDOW_STATE_TYPE_FULLSCREEN;
}
}
}