| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void WindowState::SetDelegate(scoped_ptr<WindowStateDelegate> delegate) { | 94 void WindowState::SetDelegate(scoped_ptr<WindowStateDelegate> delegate) { |
| 95 DCHECK(!delegate_.get()); | 95 DCHECK(!delegate_.get()); |
| 96 delegate_ = delegate.Pass(); | 96 delegate_ = delegate.Pass(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 WindowStateType WindowState::GetStateType() const { | 99 WindowStateType WindowState::GetStateType() const { |
| 100 return current_state_->GetType(); | 100 return current_state_->GetType(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool WindowState::IsMinimized() const { | 103 bool WindowState::IsMinimized() const { |
| 104 return GetStateType() == WINDOW_STATE_TYPE_MINIMIZED; | 104 return GetStateType() == WINDOW_STATE_TYPE_MINIMIZED || |
| 105 GetStateType() == WINDOW_STATE_TYPE_DOCKED_MINIMIZED; |
| 105 } | 106 } |
| 106 | 107 |
| 107 bool WindowState::IsMaximized() const { | 108 bool WindowState::IsMaximized() const { |
| 108 return GetStateType() == WINDOW_STATE_TYPE_MAXIMIZED; | 109 return GetStateType() == WINDOW_STATE_TYPE_MAXIMIZED; |
| 109 } | 110 } |
| 110 | 111 |
| 111 bool WindowState::IsFullscreen() const { | 112 bool WindowState::IsFullscreen() const { |
| 112 return GetStateType() == WINDOW_STATE_TYPE_FULLSCREEN; | 113 return GetStateType() == WINDOW_STATE_TYPE_FULLSCREEN; |
| 113 } | 114 } |
| 114 | 115 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 129 | 130 |
| 130 bool WindowState::IsNormalOrSnapped() const { | 131 bool WindowState::IsNormalOrSnapped() const { |
| 131 return IsNormalStateType() || IsSnapped(); | 132 return IsNormalStateType() || IsSnapped(); |
| 132 } | 133 } |
| 133 | 134 |
| 134 bool WindowState::IsActive() const { | 135 bool WindowState::IsActive() const { |
| 135 return IsActiveWindow(window_); | 136 return IsActiveWindow(window_); |
| 136 } | 137 } |
| 137 | 138 |
| 138 bool WindowState::IsDocked() const { | 139 bool WindowState::IsDocked() const { |
| 139 return window_->parent() && | 140 return GetStateType() == WINDOW_STATE_TYPE_DOCKED || |
| 140 window_->parent()->id() == kShellWindowId_DockedContainer; | 141 GetStateType() == WINDOW_STATE_TYPE_DOCKED_MINIMIZED; |
| 141 } | 142 } |
| 142 | 143 |
| 143 bool WindowState::CanMaximize() const { | 144 bool WindowState::CanMaximize() const { |
| 144 // Window must have the kCanMaximizeKey and have no maximum width or height. | 145 // Window must have the kCanMaximizeKey and have no maximum width or height. |
| 145 if (!window()->GetProperty(aura::client::kCanMaximizeKey)) | 146 if (!window()->GetProperty(aura::client::kCanMaximizeKey)) |
| 146 return false; | 147 return false; |
| 147 | 148 |
| 148 if (!window()->delegate()) | 149 if (!window()->delegate()) |
| 149 return true; | 150 return true; |
| 150 | 151 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 459 } |
| 459 return settings; | 460 return settings; |
| 460 } | 461 } |
| 461 | 462 |
| 462 const WindowState* GetWindowState(const aura::Window* window) { | 463 const WindowState* GetWindowState(const aura::Window* window) { |
| 463 return GetWindowState(const_cast<aura::Window*>(window)); | 464 return GetWindowState(const_cast<aura::Window*>(window)); |
| 464 } | 465 } |
| 465 | 466 |
| 466 } // namespace wm | 467 } // namespace wm |
| 467 } // namespace ash | 468 } // namespace ash |
| OLD | NEW |