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()); |
} |
} |