| 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/wm/window_state.h" | 5 #include "ash/wm/window_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 OnPostWindowStateTypeChange(this, old_window_state_type)); | 408 OnPostWindowStateTypeChange(this, old_window_state_type)); |
| 409 } | 409 } |
| 410 | 410 |
| 411 void WindowState::SetBoundsDirect(const gfx::Rect& bounds) { | 411 void WindowState::SetBoundsDirect(const gfx::Rect& bounds) { |
| 412 gfx::Rect actual_new_bounds(bounds); | 412 gfx::Rect actual_new_bounds(bounds); |
| 413 // Ensure we don't go smaller than our minimum bounds in "normal" window | 413 // Ensure we don't go smaller than our minimum bounds in "normal" window |
| 414 // modes | 414 // modes |
| 415 if (window_->delegate() && !IsMaximized() && !IsFullscreen()) { | 415 if (window_->delegate() && !IsMaximized() && !IsFullscreen()) { |
| 416 // Get the minimum usable size of the minimum size and the screen size. | 416 // Get the minimum usable size of the minimum size and the screen size. |
| 417 gfx::Size min_size = window_->delegate()->GetMinimumSize(); | 417 gfx::Size min_size = window_->delegate()->GetMinimumSize(); |
| 418 min_size.SetToMin(gfx::Screen::GetScreenFor( | 418 min_size.SetToMin(gfx::Screen::GetScreen() |
| 419 window_)->GetDisplayNearestWindow(window_).work_area().size()); | 419 ->GetDisplayNearestWindow(window_) |
| 420 .work_area() |
| 421 .size()); |
| 420 | 422 |
| 421 actual_new_bounds.set_width( | 423 actual_new_bounds.set_width( |
| 422 std::max(min_size.width(), actual_new_bounds.width())); | 424 std::max(min_size.width(), actual_new_bounds.width())); |
| 423 actual_new_bounds.set_height( | 425 actual_new_bounds.set_height( |
| 424 std::max(min_size.height(), actual_new_bounds.height())); | 426 std::max(min_size.height(), actual_new_bounds.height())); |
| 425 } | 427 } |
| 426 BoundsSetter().SetBounds(window_, actual_new_bounds); | 428 BoundsSetter().SetBounds(window_, actual_new_bounds); |
| 427 SnapWindowToPixelBoundary(window_); | 429 SnapWindowToPixelBoundary(window_); |
| 428 } | 430 } |
| 429 | 431 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 } | 499 } |
| 498 return settings; | 500 return settings; |
| 499 } | 501 } |
| 500 | 502 |
| 501 const WindowState* GetWindowState(const aura::Window* window) { | 503 const WindowState* GetWindowState(const aura::Window* window) { |
| 502 return GetWindowState(const_cast<aura::Window*>(window)); | 504 return GetWindowState(const_cast<aura::Window*>(window)); |
| 503 } | 505 } |
| 504 | 506 |
| 505 } // namespace wm | 507 } // namespace wm |
| 506 } // namespace ash | 508 } // namespace ash |
| OLD | NEW |