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 b96fc2e3ea113db8dae66a7ab25efa0d5fad0395..a3ff332f1da2654c724f2d5df9a71b6226be09d7 100644 |
| --- a/ash/wm/maximize_mode/maximize_mode_window_state.cc |
| +++ b/ash/wm/maximize_mode/maximize_mode_window_state.cc |
| @@ -6,29 +6,16 @@ |
| #include <utility> |
| -#include "ash/aura/wm_window_aura.h" |
| #include "ash/common/shell_window_ids.h" |
| #include "ash/common/wm/window_animation_types.h" |
| -#include "ash/common/wm/window_state_delegate.h" |
| #include "ash/common/wm/window_state_util.h" |
| #include "ash/common/wm/wm_event.h" |
| #include "ash/common/wm/wm_screen_util.h" |
| -#include "ash/common/wm/workspace/workspace_window_resizer.h" |
| #include "ash/common/wm_shell.h" |
| -#include "ash/screen_util.h" |
| -#include "ash/shell.h" |
| +#include "ash/common/wm_window.h" |
| #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" |
| -#include "ash/wm/window_animations.h" |
| -#include "ash/wm/window_properties.h" |
| -#include "ash/wm/window_state_aura.h" |
| -#include "ash/wm/window_util.h" |
| -#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/geometry/rect.h" |
| -#include "ui/views/view_constants_aura.h" |
| -#include "ui/views/widget/widget.h" |
| namespace ash { |
| namespace { |
| @@ -112,12 +99,13 @@ void MaximizeModeWindowState::UpdateWindowPosition( |
| } |
| MaximizeModeWindowState::MaximizeModeWindowState( |
| - aura::Window* window, MaximizeModeWindowManager* creator) |
| + WmWindow* window, |
| + MaximizeModeWindowManager* creator) |
| : window_(window), |
| creator_(creator), |
| - current_state_type_(wm::GetWindowState(window)->GetStateType()), |
| + current_state_type_(window->GetWindowState()->GetStateType()), |
| defer_bounds_updates_(false) { |
| - old_state_.reset(wm::GetWindowState(window) |
| + old_state_.reset(window_->GetWindowState() |
| ->SetStateObject(std::unique_ptr<State>(this)) |
| .release()); |
| } |
| @@ -138,7 +126,7 @@ void MaximizeModeWindowState::SetDeferBoundsUpdates(bool defer_bounds_updates) { |
| defer_bounds_updates_ = defer_bounds_updates; |
| if (!defer_bounds_updates_) |
| - UpdateBounds(wm::GetWindowState(window_), true); |
| + UpdateBounds(window_->GetWindowState(), true); |
| } |
| void MaximizeModeWindowState::OnWMEvent(wm::WindowState* window_state, |
| @@ -230,16 +218,12 @@ void MaximizeModeWindowState::AttachState( |
| wm::WindowState::State* previous_state) { |
| current_state_type_ = previous_state->GetType(); |
| - aura::Window* window = |
| - ash::WmWindowAura::GetAuraWindow(window_state->window()); |
| gfx::Rect restore_bounds = GetRestoreBounds(window_state); |
| if (!restore_bounds.IsEmpty()) { |
| // We do not want to do a session restore to our window states. Therefore |
| // we tell the window to use the current default states instead. |
| - window->SetProperty(ash::kRestoreShowStateOverrideKey, |
| - window_state->GetShowState()); |
| - window->SetProperty(ash::kRestoreBoundsOverrideKey, |
| - new gfx::Rect(restore_bounds)); |
| + window_state->window()->SetRestoreOverrides(restore_bounds, |
| + window_state->GetShowState()); |
| } |
| // Initialize the state to a good preset. |
| @@ -257,8 +241,8 @@ void MaximizeModeWindowState::AttachState( |
| void MaximizeModeWindowState::DetachState(wm::WindowState* window_state) { |
| // From now on, we can use the default session restore mechanism again. |
| - ash::WmWindowAura::GetAuraWindow(window_state->window()) |
| - ->ClearProperty(ash::kRestoreBoundsOverrideKey); |
| + window_state->window()->SetRestoreOverrides(gfx::Rect(), |
|
James Cook
2016/06/27 00:19:21
I like that you combined these into a single set/c
|
| + ui::SHOW_STATE_NORMAL); |
| window_state->set_can_be_dragged(true); |
| } |