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_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ | 5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ |
6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ | 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // change get animated. | 55 // change get animated. |
56 void UpdateWindow(wm::WindowState* window_state, | 56 void UpdateWindow(wm::WindowState* window_state, |
57 wm::WindowStateType new_state_type, | 57 wm::WindowStateType new_state_type, |
58 bool animate); | 58 bool animate); |
59 | 59 |
60 // Depending on the capabilities of the window we either return | 60 // Depending on the capabilities of the window we either return |
61 // |WINDOW_STATE_TYPE_MAXIMIZED| or |WINDOW_STATE_TYPE_NORMAL|. | 61 // |WINDOW_STATE_TYPE_MAXIMIZED| or |WINDOW_STATE_TYPE_NORMAL|. |
62 wm::WindowStateType GetMaximizedOrCenteredWindowType( | 62 wm::WindowStateType GetMaximizedOrCenteredWindowType( |
63 wm::WindowState* window_state); | 63 wm::WindowState* window_state); |
64 | 64 |
| 65 // If |target_state| is LEFT/RIGHT_SNAPPED and the window can be snapped, |
| 66 // return |target_state|. Otherwise depending on the capabilities of the |
| 67 // window we either return |WINDOW_STATE_TYPE_MAXIMIZED| or |
| 68 // |WINDOW_STATE_TYPE_NORMAL|. |
| 69 wm::WindowStateType GetSnappedWindowStateType( |
| 70 wm::WindowState* window_state, |
| 71 wm::WindowStateType target_state); |
| 72 |
65 // Updates the bounds to the maximum possible bounds according to the current | 73 // Updates the bounds to the maximum possible bounds according to the current |
66 // window state. If |animated| is set we animate the change. | 74 // window state. If |animated| is set we animate the change. |
67 void UpdateBounds(wm::WindowState* window_state, bool animated); | 75 void UpdateBounds(wm::WindowState* window_state, bool animated); |
68 | 76 |
69 // The original state object of the window. | 77 // The original state object of the window. |
70 std::unique_ptr<wm::WindowState::State> old_state_; | 78 std::unique_ptr<wm::WindowState::State> old_state_; |
71 | 79 |
72 // The window whose WindowState owns this instance. | 80 // The window whose WindowState owns this instance. |
73 aura::Window* window_; | 81 aura::Window* window_; |
74 | 82 |
75 // The creator which needs to be informed when this state goes away. | 83 // The creator which needs to be informed when this state goes away. |
76 MaximizeModeWindowManager* creator_; | 84 MaximizeModeWindowManager* creator_; |
77 | 85 |
78 // The current state type. Due to the nature of this state, this can only be | 86 // The current state type. Due to the nature of this state, this can only be |
79 // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. | 87 // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. |
80 wm::WindowStateType current_state_type_; | 88 wm::WindowStateType current_state_type_; |
81 | 89 |
82 // If true, do not update bounds. | 90 // If true, do not update bounds. |
83 bool defer_bounds_updates_; | 91 bool defer_bounds_updates_; |
84 | 92 |
85 // If true, the state will not process events. | 93 // If true, the state will not process events. |
86 bool ignore_wm_events_ = false; | 94 bool ignore_wm_events_ = false; |
87 | 95 |
88 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowState); | 96 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowState); |
89 }; | 97 }; |
90 | 98 |
91 } // namespace ash | 99 } // namespace ash |
92 | 100 |
93 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ | 101 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ |
OLD | NEW |