Home | History | Annotate | Download | only in wm
      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 #include "ash/wm/wm_types.h"
      6 
      7 #include "base/basictypes.h"
      8 #include "base/logging.h"
      9 
     10 namespace ash {
     11 namespace wm {
     12 
     13 // This is to catch the change to WindowShowState.
     14 COMPILE_ASSERT(
     15     ui::SHOW_STATE_END == static_cast<ui::WindowShowState>(SHOW_TYPE_END),
     16     show_enum_mismatch);
     17 
     18 WindowShowType ToWindowShowType(ui::WindowShowState state) {
     19   return static_cast<WindowShowType>(state);
     20 }
     21 
     22 ui::WindowShowState ToWindowShowState(WindowShowType type) {
     23   switch (type) {
     24     case SHOW_TYPE_DEFAULT:
     25       return ui::SHOW_STATE_DEFAULT;
     26     case SHOW_TYPE_NORMAL:
     27     case SHOW_TYPE_RIGHT_SNAPPED:
     28     case SHOW_TYPE_LEFT_SNAPPED:
     29     case SHOW_TYPE_AUTO_POSITIONED:
     30       return ui::SHOW_STATE_NORMAL;
     31     case SHOW_TYPE_MINIMIZED:
     32       return ui::SHOW_STATE_MINIMIZED;
     33     case SHOW_TYPE_MAXIMIZED:
     34       return ui::SHOW_STATE_MAXIMIZED;
     35     case SHOW_TYPE_INACTIVE:
     36       return ui::SHOW_STATE_INACTIVE;
     37     case SHOW_TYPE_FULLSCREEN:
     38       return ui::SHOW_STATE_FULLSCREEN;
     39     case SHOW_TYPE_DETACHED:
     40       return ui::SHOW_STATE_DETACHED;
     41     case SHOW_TYPE_END:
     42       NOTREACHED();
     43   }
     44   NOTREACHED();
     45   return ui::SHOW_STATE_DEFAULT;
     46 }
     47 
     48 }  // namespace wm
     49 }  // namespace ash
     50