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

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

Issue 623613004: Revert of 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 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
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
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