| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMMON_WM_WM_EVENT_H_ | 5 #ifndef ASH_COMMON_WM_WM_EVENT_H_ |
| 6 #define ASH_COMMON_WM_WM_EVENT_H_ | 6 #define ASH_COMMON_WM_WM_EVENT_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/wm/wm_types.h" | 9 #include "ash/common/wm/wm_types.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 namespace wm { | 14 namespace wm { |
| 15 | 15 |
| 16 // WMEventType defines a set of operations that can change the | 16 // WMEventType defines a set of operations that can change the |
| 17 // window's state type and bounds. | 17 // window's state type and bounds. |
| 18 enum WMEventType { | 18 enum WMEventType { |
| 19 // Following events are the request to become corresponding state. | 19 // Following events are the request to become corresponding state. |
| 20 // Note that this does not mean the window will be in corresponding | 20 // Note that this does not mean the window will be in corresponding |
| 21 // state and the request may not be fullfilled. | 21 // state and the request may not be fullfilled. |
| 22 | 22 |
| 23 // NORMAL is used as a restore operation with a few exceptions. | 23 // NORMAL is used as a restore operation with a few exceptions. |
| 24 WM_EVENT_NORMAL, | 24 WM_EVENT_NORMAL, |
| 25 WM_EVENT_MAXIMIZE, | 25 WM_EVENT_MAXIMIZE, |
| 26 WM_EVENT_MINIMIZE, | 26 WM_EVENT_MINIMIZE, |
| 27 WM_EVENT_FULLSCREEN, | 27 WM_EVENT_FULLSCREEN, |
| 28 WM_EVENT_SNAP_LEFT, | 28 WM_EVENT_SNAP_LEFT, |
| 29 WM_EVENT_SNAP_RIGHT, | 29 WM_EVENT_SNAP_RIGHT, |
| 30 WM_EVENT_DOCK, | |
| 31 | 30 |
| 32 // A window is requested to be the given bounds. The request may or | 31 // A window is requested to be the given bounds. The request may or |
| 33 // may not be fulfilled depending on the requested bounds and window's | 32 // may not be fulfilled depending on the requested bounds and window's |
| 34 // state. This will not change the window state type. | 33 // state. This will not change the window state type. |
| 35 WM_EVENT_SET_BOUNDS, | 34 WM_EVENT_SET_BOUNDS, |
| 36 | 35 |
| 37 // Following events are compond events which may lead to different | 36 // Following events are compond events which may lead to different |
| 38 // states depending on the current state. | 37 // states depending on the current state. |
| 39 | 38 |
| 40 // A user requested to toggle maximized state by double clicking window | 39 // A user requested to toggle maximized state by double clicking window |
| 41 // header. | 40 // header. |
| 42 WM_EVENT_TOGGLE_MAXIMIZE_CAPTION, | 41 WM_EVENT_TOGGLE_MAXIMIZE_CAPTION, |
| 43 | 42 |
| 44 // A user requested to toggle maximized state using shortcut. | 43 // A user requested to toggle maximized state using shortcut. |
| 45 WM_EVENT_TOGGLE_MAXIMIZE, | 44 WM_EVENT_TOGGLE_MAXIMIZE, |
| 46 | 45 |
| 47 // A user requested to toggle vertical maximize by double clicking | 46 // A user requested to toggle vertical maximize by double clicking |
| 48 // top/bottom edge. | 47 // top/bottom edge. |
| 49 WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE, | 48 WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE, |
| 50 | 49 |
| 51 // A user requested to toggle horizontal maximize by double clicking | 50 // A user requested to toggle horizontal maximize by double clicking |
| 52 // left/right edge. | 51 // left/right edge. |
| 53 WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE, | 52 WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE, |
| 54 | 53 |
| 55 // A user requested to toggle fullscreen state. | 54 // A user requested to toggle fullscreen state. |
| 56 WM_EVENT_TOGGLE_FULLSCREEN, | 55 WM_EVENT_TOGGLE_FULLSCREEN, |
| 57 | 56 |
| 58 // A user requested a cycle of dock and snap left. | 57 // A user requested a cycle of snap left. |
| 59 // The way this event is processed is the current window state is used as | 58 // The way this event is processed is the current window state is used as |
| 60 // the starting state. Assuming normal window start state; if the window can | 59 // the starting state. Assuming normal window start state; if the window can |
| 61 // be snapped left, snap it; otherwise progress to next state. If the window | 60 // be snapped left, snap it; otherwise progress to next state. If the |
| 62 // can be docked left, dock it; otherwise progress to next state. If the | |
| 63 // window can be restored; and this isn't the entry condition restore it; | 61 // window can be restored; and this isn't the entry condition restore it; |
| 64 // otherwise apply the bounce animation to the window. | 62 // otherwise apply the bounce animation to the window. |
| 65 WM_EVENT_CYCLE_SNAP_DOCK_LEFT, | 63 WM_EVENT_CYCLE_SNAP_LEFT, |
| 66 | 64 |
| 67 // A user requested a cycle of dock and snap right. | 65 // A user requested a cycle of snap right. |
| 68 // See decription of WM_EVENT_CYCLE_SNAP_DOCK_LEFT. | 66 // See decription of WM_EVENT_CYCLE_SNAP_LEFT. |
| 69 WM_EVENT_CYCLE_SNAP_DOCK_RIGHT, | 67 WM_EVENT_CYCLE_SNAP_RIGHT, |
| 70 | 68 |
| 71 // A user requested to center a window. | 69 // A user requested to center a window. |
| 72 WM_EVENT_CENTER, | 70 WM_EVENT_CENTER, |
| 73 | 71 |
| 74 // TODO(oshima): Investigate if this can be removed from ash. | 72 // TODO(oshima): Investigate if this can be removed from ash. |
| 75 // Widget requested to show in inactive state. | 73 // Widget requested to show in inactive state. |
| 76 WM_EVENT_SHOW_INACTIVE, | 74 WM_EVENT_SHOW_INACTIVE, |
| 77 | 75 |
| 78 // Following events are generated when the workspace envrionment has changed. | 76 // Following events are generated when the workspace envrionment has changed. |
| 79 // The window's state type will not be changed by these events. | 77 // The window's state type will not be changed by these events. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 private: | 118 private: |
| 121 gfx::Rect requested_bounds_; | 119 gfx::Rect requested_bounds_; |
| 122 | 120 |
| 123 DISALLOW_COPY_AND_ASSIGN(SetBoundsEvent); | 121 DISALLOW_COPY_AND_ASSIGN(SetBoundsEvent); |
| 124 }; | 122 }; |
| 125 | 123 |
| 126 } // namespace wm | 124 } // namespace wm |
| 127 } // namespace ash | 125 } // namespace ash |
| 128 | 126 |
| 129 #endif // ASH_COMMON_WM_WM_EVENT_H_ | 127 #endif // ASH_COMMON_WM_WM_EVENT_H_ |
| OLD | NEW |