| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 bool WindowState::IsActive() const { | 137 bool WindowState::IsActive() const { |
| 138 return IsActiveWindow(window_); | 138 return IsActiveWindow(window_); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool WindowState::IsDocked() const { | 141 bool WindowState::IsDocked() const { |
| 142 return GetStateType() == WINDOW_STATE_TYPE_DOCKED || | 142 return GetStateType() == WINDOW_STATE_TYPE_DOCKED || |
| 143 GetStateType() == WINDOW_STATE_TYPE_DOCKED_MINIMIZED; | 143 GetStateType() == WINDOW_STATE_TYPE_DOCKED_MINIMIZED; |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool WindowState::IsUserPositionable() const { |
| 147 return (window()->type() == ui::wm::WINDOW_TYPE_NORMAL || |
| 148 window()->type() == ui::wm::WINDOW_TYPE_PANEL); |
| 149 } |
| 150 |
| 146 bool WindowState::CanMaximize() const { | 151 bool WindowState::CanMaximize() const { |
| 147 // Window must have the kCanMaximizeKey and have no maximum width or height. | 152 // Window must have the kCanMaximizeKey and have no maximum width or height. |
| 148 if (!window()->GetProperty(aura::client::kCanMaximizeKey)) | 153 if (!window()->GetProperty(aura::client::kCanMaximizeKey)) |
| 149 return false; | 154 return false; |
| 150 | 155 |
| 151 if (!window()->delegate()) | 156 if (!window()->delegate()) |
| 152 return true; | 157 return true; |
| 153 | 158 |
| 154 gfx::Size max_size = window_->delegate()->GetMaximumSize(); | 159 gfx::Size max_size = window_->delegate()->GetMaximumSize(); |
| 155 return !max_size.width() && !max_size.height(); | 160 return !max_size.width() && !max_size.height(); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 458 } |
| 454 return settings; | 459 return settings; |
| 455 } | 460 } |
| 456 | 461 |
| 457 const WindowState* GetWindowState(const aura::Window* window) { | 462 const WindowState* GetWindowState(const aura::Window* window) { |
| 458 return GetWindowState(const_cast<aura::Window*>(window)); | 463 return GetWindowState(const_cast<aura::Window*>(window)); |
| 459 } | 464 } |
| 460 | 465 |
| 461 } // namespace wm | 466 } // namespace wm |
| 462 } // namespace ash | 467 } // namespace ash |
| OLD | NEW |