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 12 matching lines...) Expand all Loading... |
23 // Called when the window position might need to be updated. | 23 // Called when the window position might need to be updated. |
24 static void UpdateWindowPosition(wm::WindowState* window_state); | 24 static void UpdateWindowPosition(wm::WindowState* window_state); |
25 | 25 |
26 // The |window|'s state object will be modified to use this new window mode | 26 // The |window|'s state object will be modified to use this new window mode |
27 // state handler. Upon destruction it will restore the previous state handler | 27 // state handler. Upon destruction it will restore the previous state handler |
28 // and call |creator::WindowStateDestroyed()| to inform that the window mode | 28 // and call |creator::WindowStateDestroyed()| to inform that the window mode |
29 // was reverted to the old window manager. | 29 // was reverted to the old window manager. |
30 MaximizeModeWindowState(WmWindow* window, MaximizeModeWindowManager* creator); | 30 MaximizeModeWindowState(WmWindow* window, MaximizeModeWindowManager* creator); |
31 ~MaximizeModeWindowState() override; | 31 ~MaximizeModeWindowState() override; |
32 | 32 |
| 33 void set_ignore_wm_events(bool ignore) { ignore_wm_events_ = ignore; } |
| 34 |
33 // Leaves the maximize mode by reverting to previous state object. | 35 // Leaves the maximize mode by reverting to previous state object. |
34 void LeaveMaximizeMode(wm::WindowState* window_state); | 36 void LeaveMaximizeMode(wm::WindowState* window_state); |
35 | 37 |
36 // Sets whether to ignore bounds updates. If set to false, immediately does a | 38 // Sets whether to ignore bounds updates. If set to false, immediately does a |
37 // bounds update as the current window bounds may no longer be correct. | 39 // bounds update as the current window bounds may no longer be correct. |
38 void SetDeferBoundsUpdates(bool defer_bounds_updates); | 40 void SetDeferBoundsUpdates(bool defer_bounds_updates); |
39 | 41 |
40 // WindowState::State overrides: | 42 // WindowState::State overrides: |
41 void OnWMEvent(wm::WindowState* window_state, | 43 void OnWMEvent(wm::WindowState* window_state, |
42 const wm::WMEvent* event) override; | 44 const wm::WMEvent* event) override; |
(...skipping 30 matching lines...) Expand all Loading... |
73 // The creator which needs to be informed when this state goes away. | 75 // The creator which needs to be informed when this state goes away. |
74 MaximizeModeWindowManager* creator_; | 76 MaximizeModeWindowManager* creator_; |
75 | 77 |
76 // The current state type. Due to the nature of this state, this can only be | 78 // The current state type. Due to the nature of this state, this can only be |
77 // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. | 79 // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. |
78 wm::WindowStateType current_state_type_; | 80 wm::WindowStateType current_state_type_; |
79 | 81 |
80 // If true, do not update bounds. | 82 // If true, do not update bounds. |
81 bool defer_bounds_updates_; | 83 bool defer_bounds_updates_; |
82 | 84 |
| 85 // If true, the state will not process events. |
| 86 bool ignore_wm_events_ = false; |
| 87 |
83 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowState); | 88 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowState); |
84 }; | 89 }; |
85 | 90 |
86 } // namespace ash | 91 } // namespace ash |
87 | 92 |
88 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ | 93 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ |
OLD | NEW |