| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 bool WindowState::IsUserPositionable() const { | 109 bool WindowState::IsUserPositionable() const { |
| 110 return (window_->GetType() == ui::wm::WINDOW_TYPE_NORMAL || | 110 return (window_->GetType() == ui::wm::WINDOW_TYPE_NORMAL || |
| 111 window_->GetType() == ui::wm::WINDOW_TYPE_PANEL); | 111 window_->GetType() == ui::wm::WINDOW_TYPE_PANEL); |
| 112 } | 112 } |
| 113 | 113 |
| 114 bool WindowState::ShouldBeExcludedFromMru() const { | 114 bool WindowState::ShouldBeExcludedFromMru() const { |
| 115 return window_->GetBoolProperty(ash::WmWindowProperty::EXCLUDE_FROM_MRU); | 115 return window_->GetBoolProperty(ash::WmWindowProperty::EXCLUDE_FROM_MRU); |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool WindowState::CanMaximize() const { | 118 bool WindowState::CanMaximize() const { |
| 119 // Window must have the kCanMaximizeKey and have no maximum width or height. | 119 // Window must allow maximization and have no maximum width or height. |
| 120 if (!window_->CanMaximize()) | 120 if (!window_->CanMaximize()) |
| 121 return false; | 121 return false; |
| 122 | 122 |
| 123 if (!window_->HasNonClientArea()) | 123 if (!window_->HasNonClientArea()) |
| 124 return true; | 124 return true; |
| 125 | 125 |
| 126 gfx::Size max_size = window_->GetMaximumSize(); | 126 gfx::Size max_size = window_->GetMaximumSize(); |
| 127 return !max_size.width() && !max_size.height(); | 127 return !max_size.width() && !max_size.height(); |
| 128 } | 128 } |
| 129 | 129 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 if (!window_->GetTargetVisibility()) { | 396 if (!window_->GetTargetVisibility()) { |
| 397 SetBoundsConstrained(new_bounds); | 397 SetBoundsConstrained(new_bounds); |
| 398 return; | 398 return; |
| 399 } | 399 } |
| 400 | 400 |
| 401 window_->SetBoundsDirectCrossFade(new_bounds); | 401 window_->SetBoundsDirectCrossFade(new_bounds); |
| 402 } | 402 } |
| 403 | 403 |
| 404 } // namespace wm | 404 } // namespace wm |
| 405 } // namespace ash | 405 } // namespace ash |
| OLD | NEW |