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

Unified Diff: ash/wm/default_state.cc

Issue 2806783002: ash: Do not constrain window bounds if requested (Closed)
Patch Set: Remove dead code Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/default_state.cc
diff --git a/ash/wm/default_state.cc b/ash/wm/default_state.cc
index 198673a33060e703f39eb67b91851299258b24a3..9c551b1f73be5f30ec3df2e43a4e95d9a72d9bfe 100644
--- a/ash/wm/default_state.cc
+++ b/ash/wm/default_state.cc
@@ -343,6 +343,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
// If a window is opened as maximized or fullscreen, its bounds may be
// empty, so update the bounds now before checking empty.
if (window_state->is_dragged() ||
+ window_state->allow_set_bounds_direct() ||
SetMaximizedOrFullscreenBounds(window_state)) {
return true;
}
@@ -377,6 +378,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
}
case WM_EVENT_DISPLAY_BOUNDS_CHANGED: {
if (window_state->is_dragged() ||
+ window_state->allow_set_bounds_direct() ||
SetMaximizedOrFullscreenBounds(window_state)) {
return true;
}
@@ -402,6 +404,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
return true;
if (window_state->is_dragged() ||
+ window_state->allow_set_bounds_direct() ||
SetMaximizedOrFullscreenBounds(window_state)) {
return true;
}
@@ -443,6 +446,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
// static
bool DefaultState::SetMaximizedOrFullscreenBounds(WindowState* window_state) {
DCHECK(!window_state->is_dragged());
+ DCHECK(!window_state->allow_set_bounds_direct());
if (window_state->IsMaximized()) {
window_state->SetBoundsDirect(
GetMaximizedWindowBoundsInParent(window_state->window()));
@@ -459,7 +463,7 @@ bool DefaultState::SetMaximizedOrFullscreenBounds(WindowState* window_state) {
// static
void DefaultState::SetBounds(WindowState* window_state,
const SetBoundsEvent* event) {
- if (window_state->is_dragged()) {
+ if (window_state->is_dragged() || window_state->allow_set_bounds_direct()) {
// TODO(oshima|varkha): Is this still needed? crbug.com/485612.
window_state->SetBoundsDirect(event->requested_bounds());
} else if (window_state->IsSnapped()) {
@@ -469,8 +473,7 @@ void DefaultState::SetBounds(WindowState* window_state,
wm::AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds);
window_state->AdjustSnappedBounds(&child_bounds);
window_state->SetBoundsDirect(child_bounds);
- } else if (!SetMaximizedOrFullscreenBounds(window_state) ||
- window_state->allow_set_bounds_in_maximized()) {
+ } else if (!SetMaximizedOrFullscreenBounds(window_state)) {
window_state->SetBoundsConstrained(event->requested_bounds());
}
}
« no previous file with comments | « no previous file | ash/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698