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

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

Issue 1157843009: Added wm::IsWindowUserPositionable(...) method in window_util.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated callsites to use WindowState::IsUserPositionable(). Created 5 years, 6 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
« no previous file with comments | « ash/wm/window_state.h ('k') | ash/wm/window_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 bool WindowState::IsActive() const { 137 bool WindowState::IsActive() const {
138 return IsActiveWindow(window_); 138 return IsActiveWindow(window_);
139 } 139 }
140 140
141 bool WindowState::IsDocked() const { 141 bool WindowState::IsDocked() const {
142 return GetStateType() == WINDOW_STATE_TYPE_DOCKED || 142 return GetStateType() == WINDOW_STATE_TYPE_DOCKED ||
143 GetStateType() == WINDOW_STATE_TYPE_DOCKED_MINIMIZED; 143 GetStateType() == WINDOW_STATE_TYPE_DOCKED_MINIMIZED;
144 } 144 }
145 145
146 bool WindowState::IsUserPositionable() const {
147 return (window()->type() == ui::wm::WINDOW_TYPE_NORMAL ||
148 window()->type() == ui::wm::WINDOW_TYPE_PANEL);
149 }
150
146 bool WindowState::CanMaximize() const { 151 bool WindowState::CanMaximize() const {
147 // Window must have the kCanMaximizeKey and have no maximum width or height. 152 // Window must have the kCanMaximizeKey and have no maximum width or height.
148 if (!window()->GetProperty(aura::client::kCanMaximizeKey)) 153 if (!window()->GetProperty(aura::client::kCanMaximizeKey))
149 return false; 154 return false;
150 155
151 if (!window()->delegate()) 156 if (!window()->delegate())
152 return true; 157 return true;
153 158
154 gfx::Size max_size = window_->delegate()->GetMaximumSize(); 159 gfx::Size max_size = window_->delegate()->GetMaximumSize();
155 return !max_size.width() && !max_size.height(); 160 return !max_size.width() && !max_size.height();
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 458 }
454 return settings; 459 return settings;
455 } 460 }
456 461
457 const WindowState* GetWindowState(const aura::Window* window) { 462 const WindowState* GetWindowState(const aura::Window* window) {
458 return GetWindowState(const_cast<aura::Window*>(window)); 463 return GetWindowState(const_cast<aura::Window*>(window));
459 } 464 }
460 465
461 } // namespace wm 466 } // namespace wm
462 } // namespace ash 467 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_state.h ('k') | ash/wm/window_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698