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

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

Issue 115453004: Moves management of transients out of Window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unneeded parens Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/window_modality_controller_unittest.cc ('k') | ash/wm/window_util.cc » ('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_ash.h" 9 #include "ash/screen_ash.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 bool WindowState::CanResize() const { 126 bool WindowState::CanResize() const {
127 return window_->GetProperty(aura::client::kCanResizeKey); 127 return window_->GetProperty(aura::client::kCanResizeKey);
128 } 128 }
129 129
130 bool WindowState::CanActivate() const { 130 bool WindowState::CanActivate() const {
131 return views::corewm::CanActivateWindow(window_); 131 return views::corewm::CanActivateWindow(window_);
132 } 132 }
133 133
134 bool WindowState::CanSnap() const { 134 bool WindowState::CanSnap() const {
135 if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL || 135 if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL ||
136 window_->transient_parent()) 136 views::corewm::GetTransientParent(window_))
137 return false; 137 return false;
138 // If a window has a maximum size defined, snapping may make it too big. 138 // If a window has a maximum size defined, snapping may make it too big.
139 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() : 139 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() :
140 true; 140 true;
141 } 141 }
142 142
143 bool WindowState::HasRestoreBounds() const { 143 bool WindowState::HasRestoreBounds() const {
144 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL; 144 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL;
145 } 145 }
146 146
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 323 }
324 return settings; 324 return settings;
325 } 325 }
326 326
327 const WindowState* GetWindowState(const aura::Window* window) { 327 const WindowState* GetWindowState(const aura::Window* window) {
328 return GetWindowState(const_cast<aura::Window*>(window)); 328 return GetWindowState(const_cast<aura::Window*>(window));
329 } 329 }
330 330
331 } // namespace wm 331 } // namespace wm
332 } // namespace ash 332 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_modality_controller_unittest.cc ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698