| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/common/wm/window_state.h" | 5 #include "ash/common/wm/window_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/wm/default_state.h" | 9 #include "ash/common/wm/default_state.h" |
| 10 #include "ash/common/wm/window_positioning_utils.h" | 10 #include "ash/common/wm/window_positioning_utils.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 panel_attached_(true), | 305 panel_attached_(true), |
| 306 ignored_by_shelf_(false), | 306 ignored_by_shelf_(false), |
| 307 can_consume_system_keys_(false), | 307 can_consume_system_keys_(false), |
| 308 unminimize_to_restore_bounds_(false), | 308 unminimize_to_restore_bounds_(false), |
| 309 in_immersive_fullscreen_(false), | 309 in_immersive_fullscreen_(false), |
| 310 hide_shelf_when_fullscreen_(true), | 310 hide_shelf_when_fullscreen_(true), |
| 311 minimum_visibility_(false), | 311 minimum_visibility_(false), |
| 312 can_be_dragged_(true), | 312 can_be_dragged_(true), |
| 313 cached_always_on_top_(false), | 313 cached_always_on_top_(false), |
| 314 ignore_property_change_(false), | 314 ignore_property_change_(false), |
| 315 current_state_(new DefaultState(ToWindowStateType(GetShowState()))) {} | 315 current_state_(new DefaultState(ToWindowStateType(GetShowState()))), |
| 316 vk_restore_bounds_(gfx::Rect()) { |
| 317 window->AddObserver(this); |
| 318 } |
| 316 | 319 |
| 317 bool WindowState::GetAlwaysOnTop() const { | 320 bool WindowState::GetAlwaysOnTop() const { |
| 318 return window_->IsAlwaysOnTop(); | 321 return window_->IsAlwaysOnTop(); |
| 319 } | 322 } |
| 320 | 323 |
| 321 ui::WindowShowState WindowState::GetShowState() const { | 324 ui::WindowShowState WindowState::GetShowState() const { |
| 322 return window_->GetShowState(); | 325 return window_->GetShowState(); |
| 323 } | 326 } |
| 324 | 327 |
| 325 void WindowState::SetBoundsInScreen(const gfx::Rect& bounds_in_screen) { | 328 void WindowState::SetBoundsInScreen(const gfx::Rect& bounds_in_screen) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 // No animation is necessary in that case, thus just change the bounds and | 397 // No animation is necessary in that case, thus just change the bounds and |
| 395 // quit. | 398 // quit. |
| 396 if (!window_->GetTargetVisibility()) { | 399 if (!window_->GetTargetVisibility()) { |
| 397 SetBoundsConstrained(new_bounds); | 400 SetBoundsConstrained(new_bounds); |
| 398 return; | 401 return; |
| 399 } | 402 } |
| 400 | 403 |
| 401 window_->SetBoundsDirectCrossFade(new_bounds); | 404 window_->SetBoundsDirectCrossFade(new_bounds); |
| 402 } | 405 } |
| 403 | 406 |
| 407 void WindowState::OnWindowPropertyChanged(WmWindow* window, |
| 408 WmWindowProperty property) { |
| 409 if (property != ash::WmWindowProperty::VK_NEW_BOUNDS) |
| 410 return; |
| 411 |
| 412 gfx::Rect* new_bounds = window->GetRectProperty(property); |
| 413 |
| 414 if (new_bounds) { |
| 415 vk_restore_bounds_ = window->GetBounds(); |
| 416 window->SetBounds(*new_bounds); |
| 417 } else { |
| 418 window->SetBounds(vk_restore_bounds_); |
| 419 vk_restore_bounds_ = gfx::Rect(); |
| 420 } |
| 421 } |
| 422 |
| 404 } // namespace wm | 423 } // namespace wm |
| 405 } // namespace ash | 424 } // namespace ash |
| OLD | NEW |