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 #include "ash/common/wm/maximize_mode/maximize_mode_window_state.h" | 5 #include "ash/common/wm/maximize_mode/maximize_mode_window_state.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 9 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
10 #include "ash/common/wm/window_animation_types.h" | 10 #include "ash/common/wm/window_animation_types.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 case wm::WM_EVENT_MAXIMIZE: | 149 case wm::WM_EVENT_MAXIMIZE: |
150 UpdateWindow(window_state, GetMaximizedOrCenteredWindowType(window_state), | 150 UpdateWindow(window_state, GetMaximizedOrCenteredWindowType(window_state), |
151 true); | 151 true); |
152 return; | 152 return; |
153 case wm::WM_EVENT_MINIMIZE: | 153 case wm::WM_EVENT_MINIMIZE: |
154 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_MINIMIZED, true); | 154 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_MINIMIZED, true); |
155 return; | 155 return; |
156 case wm::WM_EVENT_SHOW_INACTIVE: | 156 case wm::WM_EVENT_SHOW_INACTIVE: |
157 return; | 157 return; |
158 case wm::WM_EVENT_SET_BOUNDS: | 158 case wm::WM_EVENT_SET_BOUNDS: |
159 if (window_state->allow_set_bounds_in_maximized()) { | 159 if (window_state->allow_set_bounds_direct()) { |
oshima
2017/04/12 22:27:24
this is slate code. can you just remove this?
Dominik Laskowski
2017/04/12 22:45:40
Done.
| |
160 window_state->SetBoundsConstrained( | 160 window_state->SetBoundsDirect( |
161 static_cast<const wm::SetBoundsEvent*>(event)->requested_bounds()); | 161 static_cast<const wm::SetBoundsEvent*>(event)->requested_bounds()); |
162 } else if (current_state_type_ == wm::WINDOW_STATE_TYPE_MAXIMIZED) { | 162 } else if (current_state_type_ == wm::WINDOW_STATE_TYPE_MAXIMIZED) { |
163 // Having a maximized window, it could have been created with an empty | 163 // Having a maximized window, it could have been created with an empty |
164 // size and the caller should get his size upon leaving the maximized | 164 // size and the caller should get his size upon leaving the maximized |
165 // mode. As such we set the restore bounds to the requested bounds. | 165 // mode. As such we set the restore bounds to the requested bounds. |
166 gfx::Rect bounds_in_parent = | 166 gfx::Rect bounds_in_parent = |
167 (static_cast<const wm::SetBoundsEvent*>(event))->requested_bounds(); | 167 (static_cast<const wm::SetBoundsEvent*>(event))->requested_bounds(); |
168 if (!bounds_in_parent.IsEmpty()) | 168 if (!bounds_in_parent.IsEmpty()) |
169 window_state->SetRestoreBoundsInParent(bounds_in_parent); | 169 window_state->SetRestoreBoundsInParent(bounds_in_parent); |
170 } else if (current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED && | 170 } else if (current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED && |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 // avoid flashing. | 318 // avoid flashing. |
319 if (window_state->IsMaximized()) | 319 if (window_state->IsMaximized()) |
320 window_state->SetBoundsDirectCrossFade(bounds_in_parent); | 320 window_state->SetBoundsDirectCrossFade(bounds_in_parent); |
321 else | 321 else |
322 window_state->SetBoundsDirectAnimated(bounds_in_parent); | 322 window_state->SetBoundsDirectAnimated(bounds_in_parent); |
323 } | 323 } |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 } // namespace ash | 327 } // namespace ash |
OLD | NEW |