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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return false; | 146 return false; |
147 | 147 |
148 if (!window()->delegate()) | 148 if (!window()->delegate()) |
149 return true; | 149 return true; |
150 | 150 |
151 gfx::Size max_size = window_->delegate()->GetMaximumSize(); | 151 gfx::Size max_size = window_->delegate()->GetMaximumSize(); |
152 return !max_size.width() && !max_size.height(); | 152 return !max_size.width() && !max_size.height(); |
153 } | 153 } |
154 | 154 |
155 bool WindowState::CanMinimize() const { | 155 bool WindowState::CanMinimize() const { |
156 return window()->GetProperty(aura::client::kCanMinimizeKey); | 156 RootWindowController* controller = RootWindowController::ForWindow(window_); |
| 157 if (!controller) |
| 158 return false; |
| 159 aura::Window* lockscreen = |
| 160 controller->GetContainer(kShellWindowId_LockScreenContainersContainer); |
| 161 if (lockscreen->Contains(window_)) |
| 162 return false; |
| 163 |
| 164 return true; |
157 } | 165 } |
158 | 166 |
159 bool WindowState::CanResize() const { | 167 bool WindowState::CanResize() const { |
160 return window_->GetProperty(aura::client::kCanResizeKey); | 168 return window_->GetProperty(aura::client::kCanResizeKey); |
161 } | 169 } |
162 | 170 |
163 bool WindowState::CanActivate() const { | 171 bool WindowState::CanActivate() const { |
164 return ::wm::CanActivateWindow(window_); | 172 return ::wm::CanActivateWindow(window_); |
165 } | 173 } |
166 | 174 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 } | 458 } |
451 return settings; | 459 return settings; |
452 } | 460 } |
453 | 461 |
454 const WindowState* GetWindowState(const aura::Window* window) { | 462 const WindowState* GetWindowState(const aura::Window* window) { |
455 return GetWindowState(const_cast<aura::Window*>(window)); | 463 return GetWindowState(const_cast<aura::Window*>(window)); |
456 } | 464 } |
457 | 465 |
458 } // namespace wm | 466 } // namespace wm |
459 } // namespace ash | 467 } // namespace ash |
OLD | NEW |