| Index: ash/common/wm/window_state.cc
|
| diff --git a/ash/common/wm/window_state.cc b/ash/common/wm/window_state.cc
|
| index debafcfd825ee6f6fafacad0fae0b557cb776df2..02dc6bbdffc0c0f5b7fb17aaaa280599f5b3c948 100644
|
| --- a/ash/common/wm/window_state.cc
|
| +++ b/ash/common/wm/window_state.cc
|
| @@ -312,7 +312,10 @@ WindowState::WindowState(WmWindow* window)
|
| can_be_dragged_(true),
|
| cached_always_on_top_(false),
|
| ignore_property_change_(false),
|
| - current_state_(new DefaultState(ToWindowStateType(GetShowState()))) {}
|
| + current_state_(new DefaultState(ToWindowStateType(GetShowState()))),
|
| + vk_restore_bounds_(gfx::Rect()) {
|
| + window->AddObserver(this);
|
| +}
|
|
|
| bool WindowState::GetAlwaysOnTop() const {
|
| return window_->IsAlwaysOnTop();
|
| @@ -401,5 +404,21 @@ void WindowState::SetBoundsDirectCrossFade(const gfx::Rect& new_bounds) {
|
| window_->SetBoundsDirectCrossFade(new_bounds);
|
| }
|
|
|
| +void WindowState::OnWindowPropertyChanged(WmWindow* window,
|
| + WmWindowProperty property) {
|
| + if (property != ash::WmWindowProperty::VK_NEW_BOUNDS)
|
| + return;
|
| +
|
| + gfx::Rect* new_bounds = window->GetRectProperty(property);
|
| +
|
| + if (new_bounds) {
|
| + vk_restore_bounds_ = window->GetBounds();
|
| + window->SetBounds(*new_bounds);
|
| + } else {
|
| + window->SetBounds(vk_restore_bounds_);
|
| + vk_restore_bounds_ = gfx::Rect();
|
| + }
|
| +}
|
| +
|
| } // namespace wm
|
| } // namespace ash
|
|
|