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 RootWindowController* controller = RootWindowController::ForWindow(window_); | 156 return window()->GetProperty(aura::client::kCanMinimizeKey); |
157 if (!controller) | |
158 return false; | |
159 aura::Window* lockscreen = | |
160 controller->GetContainer(kShellWindowId_LockScreenContainersContainer); | |
161 if (lockscreen->Contains(window_)) | |
162 return false; | |
oshima
2014/09/29 18:32:20
Loosk like I moved this from window_util.h in
htt
pkotwicz
2014/09/30 14:48:21
This code was added to prevent touch gestures from
| |
163 | |
164 return true; | |
165 } | 157 } |
166 | 158 |
167 bool WindowState::CanResize() const { | 159 bool WindowState::CanResize() const { |
168 return window_->GetProperty(aura::client::kCanResizeKey); | 160 return window_->GetProperty(aura::client::kCanResizeKey); |
169 } | 161 } |
170 | 162 |
171 bool WindowState::CanActivate() const { | 163 bool WindowState::CanActivate() const { |
172 return ::wm::CanActivateWindow(window_); | 164 return ::wm::CanActivateWindow(window_); |
173 } | 165 } |
174 | 166 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 } | 450 } |
459 return settings; | 451 return settings; |
460 } | 452 } |
461 | 453 |
462 const WindowState* GetWindowState(const aura::Window* window) { | 454 const WindowState* GetWindowState(const aura::Window* window) { |
463 return GetWindowState(const_cast<aura::Window*>(window)); | 455 return GetWindowState(const_cast<aura::Window*>(window)); |
464 } | 456 } |
465 | 457 |
466 } // namespace wm | 458 } // namespace wm |
467 } // namespace ash | 459 } // namespace ash |
OLD | NEW |