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

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

Issue 115153002: wm: public window_types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ozone deps Created 7 years 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 | Annotate | Revision Log
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_ash.h" 9 #include "ash/screen_ash.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 bool WindowState::CanResize() const { 130 bool WindowState::CanResize() const {
131 return window_->GetProperty(aura::client::kCanResizeKey); 131 return window_->GetProperty(aura::client::kCanResizeKey);
132 } 132 }
133 133
134 bool WindowState::CanActivate() const { 134 bool WindowState::CanActivate() const {
135 return views::corewm::CanActivateWindow(window_); 135 return views::corewm::CanActivateWindow(window_);
136 } 136 }
137 137
138 bool WindowState::CanSnap() const { 138 bool WindowState::CanSnap() const {
139 if (!CanResize() || 139 if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL ||
140 window_->type() == aura::client::WINDOW_TYPE_PANEL ||
141 window_->transient_parent()) 140 window_->transient_parent())
142 return false; 141 return false;
143 // If a window has a maximum size defined, snapping may make it too big. 142 // If a window has a maximum size defined, snapping may make it too big.
144 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() : 143 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() :
145 true; 144 true;
146 } 145 }
147 146
148 bool WindowState::HasRestoreBounds() const { 147 bool WindowState::HasRestoreBounds() const {
149 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL; 148 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL;
150 } 149 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 334 }
336 return settings; 335 return settings;
337 } 336 }
338 337
339 const WindowState* GetWindowState(const aura::Window* window) { 338 const WindowState* GetWindowState(const aura::Window* window) {
340 return GetWindowState(const_cast<aura::Window*>(window)); 339 return GetWindowState(const_cast<aura::Window*>(window));
341 } 340 }
342 341
343 } // namespace wm 342 } // namespace wm
344 } // namespace ash 343 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_positioner.cc ('k') | ash/wm/workspace/multi_window_resize_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698