Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: ash/wm/window_state.cc

Issue 613563002: Make WindowState::CanMinimize() take into account WidgetDelegate::CanMinimize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
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
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
OLDNEW
« no previous file with comments | « ash/wm/toplevel_window_event_handler_unittest.cc ('k') | chrome/browser/chromeos/login/ui/login_web_dialog_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698