Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ash/common/wm/maximize_mode/maximize_mode_window_state.cc

Issue 2250713006: Allow updating arc widget bounds in maximize/fullscreen state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/wm/default_state.cc ('k') | ash/common/wm/window_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/shell_window_ids.h" 9 #include "ash/common/shell_window_ids.h"
10 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" 10 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 case wm::WM_EVENT_DOCK: 156 case wm::WM_EVENT_DOCK:
157 UpdateWindow(window_state, GetMaximizedOrCenteredWindowType(window_state), 157 UpdateWindow(window_state, GetMaximizedOrCenteredWindowType(window_state),
158 true); 158 true);
159 return; 159 return;
160 case wm::WM_EVENT_MINIMIZE: 160 case wm::WM_EVENT_MINIMIZE:
161 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_MINIMIZED, true); 161 UpdateWindow(window_state, wm::WINDOW_STATE_TYPE_MINIMIZED, true);
162 return; 162 return;
163 case wm::WM_EVENT_SHOW_INACTIVE: 163 case wm::WM_EVENT_SHOW_INACTIVE:
164 return; 164 return;
165 case wm::WM_EVENT_SET_BOUNDS: 165 case wm::WM_EVENT_SET_BOUNDS:
166 if (current_state_type_ == wm::WINDOW_STATE_TYPE_MAXIMIZED) { 166 if (window_state->allow_set_bounds_in_maximized()) {
167 window_state->SetBoundsConstrained(
168 static_cast<const wm::SetBoundsEvent*>(event)->requested_bounds());
169 } else if (current_state_type_ == wm::WINDOW_STATE_TYPE_MAXIMIZED) {
167 // Having a maximized window, it could have been created with an empty 170 // Having a maximized window, it could have been created with an empty
168 // size and the caller should get his size upon leaving the maximized 171 // size and the caller should get his size upon leaving the maximized
169 // mode. As such we set the restore bounds to the requested bounds. 172 // mode. As such we set the restore bounds to the requested bounds.
170 gfx::Rect bounds_in_parent = 173 gfx::Rect bounds_in_parent =
171 (static_cast<const wm::SetBoundsEvent*>(event))->requested_bounds(); 174 (static_cast<const wm::SetBoundsEvent*>(event))->requested_bounds();
172 if (!bounds_in_parent.IsEmpty()) 175 if (!bounds_in_parent.IsEmpty())
173 window_state->SetRestoreBoundsInParent(bounds_in_parent); 176 window_state->SetRestoreBoundsInParent(bounds_in_parent);
174 } else if (current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED && 177 } else if (current_state_type_ != wm::WINDOW_STATE_TYPE_MINIMIZED &&
175 current_state_type_ != wm::WINDOW_STATE_TYPE_FULLSCREEN && 178 current_state_type_ != wm::WINDOW_STATE_TYPE_FULLSCREEN &&
176 current_state_type_ != wm::WINDOW_STATE_TYPE_PINNED) { 179 current_state_type_ != wm::WINDOW_STATE_TYPE_PINNED) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // avoid flashing. 319 // avoid flashing.
317 if (window_state->IsMaximized()) 320 if (window_state->IsMaximized())
318 window_state->SetBoundsDirectCrossFade(bounds_in_parent); 321 window_state->SetBoundsDirectCrossFade(bounds_in_parent);
319 else 322 else
320 window_state->SetBoundsDirectAnimated(bounds_in_parent); 323 window_state->SetBoundsDirectAnimated(bounds_in_parent);
321 } 324 }
322 } 325 }
323 } 326 }
324 327
325 } // namespace ash 328 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/default_state.cc ('k') | ash/common/wm/window_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698