| 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_WM_WM_TYPES_H_ | 5 #ifndef ASH_WM_WM_TYPES_H_ |
| 6 #define ASH_WM_WM_TYPES_H_ | 6 #define ASH_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 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 SHOW_TYPE_RIGHT_SNAPPED, | 36 SHOW_TYPE_RIGHT_SNAPPED, |
| 37 | 37 |
| 38 // A window is in this state when it is automatically placed and | 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 | 39 // sized by the window manager. (it's newly opened, or pushed to the side |
| 40 // due to new window, for example). | 40 // due to new window, for example). |
| 41 SHOW_TYPE_AUTO_POSITIONED, | 41 SHOW_TYPE_AUTO_POSITIONED, |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Set of operations that can change the window's state. | 44 // Set of operations that can change the window's state. |
| 45 enum WMEvent { | 45 enum WMEvent { |
| 46 // Following events are the request to become corresponding state. |
| 47 // Note that this does not mean the window will be in corresponding |
| 48 // state and the request may not be fullfilled. |
| 49 |
| 50 // NORMAL is used as a restore operation with a few exceptions. |
| 51 NORMAL, |
| 52 MAXIMIZE, |
| 53 MINIMIZE, |
| 54 FULLSCREEN, |
| 55 // TODO(oshima): Consolidate these two events. |
| 56 SNAP_LEFT, |
| 57 SNAP_RIGHT, |
| 58 |
| 59 // Following events are compond events which may lead to different |
| 60 // states depending on the current state. |
| 61 |
| 46 // A user requested to toggle maximized state by double clicking window | 62 // A user requested to toggle maximized state by double clicking window |
| 47 // header. | 63 // header. |
| 48 TOGGLE_MAXIMIZE_CAPTION, | 64 TOGGLE_MAXIMIZE_CAPTION, |
| 49 | 65 |
| 50 // A user requested to toggle maximized state using shortcut. | 66 // A user requested to toggle maximized state using shortcut. |
| 51 TOGGLE_MAXIMIZE, | 67 TOGGLE_MAXIMIZE, |
| 52 | 68 |
| 53 // A user requested to toggle vertical maximize by double clicking | 69 // A user requested to toggle vertical maximize by double clicking |
| 54 // top/bottom edge. | 70 // top/bottom edge. |
| 55 TOGGLE_VERTICAL_MAXIMIZE, | 71 TOGGLE_VERTICAL_MAXIMIZE, |
| 56 | 72 |
| 57 // A user requested to toggle horizontal maximize by double clicking | 73 // A user requested to toggle horizontal maximize by double clicking |
| 58 // left/right edge. | 74 // left/right edge. |
| 59 TOGGLE_HORIZONTAL_MAXIMIZE, | 75 TOGGLE_HORIZONTAL_MAXIMIZE, |
| 76 |
| 77 // A user requested to toggle fullscreen state. |
| 78 TOGGLE_FULLSCREEN, |
| 79 |
| 80 // TODO(oshima): Investigate if this can be removed from ash. |
| 81 // Widget requested to show in inactive state. |
| 82 SHOW_INACTIVE, |
| 60 }; | 83 }; |
| 61 | 84 |
| 62 // Utility functions to convert WindowShowType <-> ui::WindowShowState. | 85 // Utility functions to convert WindowShowType <-> ui::WindowShowState. |
| 63 // Note: LEFT/RIGHT MAXIMIZED, AUTO_POSITIONED type will be lost when | 86 // Note: LEFT/RIGHT MAXIMIZED, AUTO_POSITIONED type will be lost when |
| 64 // converting to ui::WindowShowState. | 87 // converting to ui::WindowShowState. |
| 65 ASH_EXPORT WindowShowType ToWindowShowType(ui::WindowShowState state); | 88 ASH_EXPORT WindowShowType ToWindowShowType(ui::WindowShowState state); |
| 66 ASH_EXPORT ui::WindowShowState ToWindowShowState(WindowShowType type); | 89 ASH_EXPORT ui::WindowShowState ToWindowShowState(WindowShowType type); |
| 67 | 90 |
| 68 // Returns true if |type| is SHOW_TYPE_MAXIMIZED or SHOW_TYPE_FULLSCREEN. | 91 // Returns true if |type| is SHOW_TYPE_MAXIMIZED or SHOW_TYPE_FULLSCREEN. |
| 69 ASH_EXPORT bool IsMaximizedOrFullscreenWindowShowType(WindowShowType type); | 92 ASH_EXPORT bool IsMaximizedOrFullscreenWindowShowType(WindowShowType type); |
| 70 | 93 |
| 71 } // namespace wm | 94 } // namespace wm |
| 72 } // namespace ash | 95 } // namespace ash |
| 73 | 96 |
| 74 #endif // ASH_WM_WM_TYPES_H_ | 97 #endif // ASH_WM_WM_TYPES_H_ |
| OLD | NEW |