Chromium Code Reviews| Index: ash/wm/maximize_mode/maximize_mode_window_state.cc |
| diff --git a/ash/wm/maximize_mode/maximize_mode_window_state.cc b/ash/wm/maximize_mode/maximize_mode_window_state.cc |
| index e30c4b1878a05804808da4e901fbfcb4a0913d9e..07f0c120a786ef560ae4e0b182df04d692477a81 100644 |
| --- a/ash/wm/maximize_mode/maximize_mode_window_state.cc |
| +++ b/ash/wm/maximize_mode/maximize_mode_window_state.cc |
| @@ -20,6 +20,7 @@ |
| #include "ui/aura/client/aura_constants.h" |
| #include "ui/aura/window.h" |
| #include "ui/aura/window_delegate.h" |
| +#include "ui/compositor/layer.h" |
| #include "ui/gfx/display.h" |
| #include "ui/gfx/rect.h" |
| #include "ui/views/view_constants_aura.h" |
| @@ -98,7 +99,8 @@ MaximizeModeWindowState::MaximizeModeWindowState( |
| aura::Window* window, MaximizeModeWindowManager* creator) |
| : window_(window), |
| creator_(creator), |
| - current_state_type_(wm::GetWindowState(window)->GetStateType()) { |
| + current_state_type_(wm::GetWindowState(window)->GetStateType()), |
| + defer_bounds_updates_(false) { |
| old_state_.reset( |
| wm::GetWindowState(window)->SetStateObject( |
| scoped_ptr<State>(this).Pass()).release()); |
| @@ -114,6 +116,15 @@ void MaximizeModeWindowState::LeaveMaximizeMode(wm::WindowState* window_state) { |
| window_state->SetStateObject(old_state_.Pass()); |
| } |
| +void MaximizeModeWindowState::SetDeferBoundsUpdates(bool defer_bounds_updates) { |
| + if (defer_bounds_updates_ == defer_bounds_updates) |
| + return; |
| + |
| + defer_bounds_updates_ = defer_bounds_updates; |
| + if (!defer_bounds_updates_) |
| + UpdateBounds(wm::GetWindowState(window_), true); |
| +} |
| + |
| void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state, |
| const wm::WMEvent* event) { |
| switch (event->type()) { |
| @@ -280,6 +291,8 @@ wm::WindowStateType MaximizeModeWindowState::GetMaximizedOrCenteredWindowType( |
| void MaximizeModeWindowState::UpdateBounds(wm::WindowState* window_state, |
| bool animated) { |
| + if (defer_bounds_updates_) |
|
Mr4D (OOO till 08-26)
2014/09/23 22:27:14
Just checking - you don't want the window to chang
flackr
2014/09/30 16:42:29
As long as the window is in overview, it should be
|
| + return; |
| gfx::Rect bounds_in_parent = GetBoundsInMaximizedMode(window_state); |
| // If we have a target bounds rectangle, we center it and set it |
| // accordingly. |