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

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

Issue 196063002: Move wm/core to wm namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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_positioner.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_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return false; 168 return false;
169 169
170 return true; 170 return true;
171 } 171 }
172 172
173 bool WindowState::CanResize() const { 173 bool WindowState::CanResize() const {
174 return window_->GetProperty(aura::client::kCanResizeKey); 174 return window_->GetProperty(aura::client::kCanResizeKey);
175 } 175 }
176 176
177 bool WindowState::CanActivate() const { 177 bool WindowState::CanActivate() const {
178 return views::corewm::CanActivateWindow(window_); 178 return ::wm::CanActivateWindow(window_);
179 } 179 }
180 180
181 bool WindowState::CanSnap() const { 181 bool WindowState::CanSnap() const {
182 if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL || 182 if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL ||
183 views::corewm::GetTransientParent(window_)) 183 ::wm::GetTransientParent(window_))
184 return false; 184 return false;
185 // If a window has a maximum size defined, snapping may make it too big. 185 // If a window has a maximum size defined, snapping may make it too big.
186 // TODO(oshima): We probably should snap if possible. 186 // TODO(oshima): We probably should snap if possible.
187 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() : 187 return window_->delegate() ? window_->delegate()->GetMaximumSize().IsEmpty() :
188 true; 188 true;
189 } 189 }
190 190
191 bool WindowState::HasRestoreBounds() const { 191 bool WindowState::HasRestoreBounds() const {
192 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL; 192 return window_->GetProperty(aura::client::kRestoreBoundsKey) != NULL;
193 } 193 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 376 }
377 377
378 const gfx::Rect old_bounds = window_->bounds(); 378 const gfx::Rect old_bounds = window_->bounds();
379 379
380 // Create fresh layers for the window and all its children to paint into. 380 // Create fresh layers for the window and all its children to paint into.
381 // Takes ownership of the old layer and all its children, which will be 381 // Takes ownership of the old layer and all its children, which will be
382 // cleaned up after the animation completes. 382 // cleaned up after the animation completes.
383 // Specify |set_bounds| to true here to keep the old bounds in the child 383 // Specify |set_bounds| to true here to keep the old bounds in the child
384 // windows of |window|. 384 // windows of |window|.
385 scoped_ptr<ui::LayerTreeOwner> old_layer_owner = 385 scoped_ptr<ui::LayerTreeOwner> old_layer_owner =
386 views::corewm::RecreateLayers(window_); 386 ::wm::RecreateLayers(window_);
387 ui::Layer* old_layer = old_layer_owner->root(); 387 ui::Layer* old_layer = old_layer_owner->root();
388 DCHECK(old_layer); 388 DCHECK(old_layer);
389 ui::Layer* new_layer = window_->layer(); 389 ui::Layer* new_layer = window_->layer();
390 390
391 // Resize the window to the new size, which will force a layout and paint. 391 // Resize the window to the new size, which will force a layout and paint.
392 SetBoundsDirect(new_bounds); 392 SetBoundsDirect(new_bounds);
393 393
394 // Ensure the higher-resolution layer is on top. 394 // Ensure the higher-resolution layer is on top.
395 bool old_on_top = (old_bounds.width() > new_bounds.width()); 395 bool old_on_top = (old_bounds.width() > new_bounds.width());
396 if (old_on_top) 396 if (old_on_top)
(...skipping 19 matching lines...) Expand all
416 } 416 }
417 return settings; 417 return settings;
418 } 418 }
419 419
420 const WindowState* GetWindowState(const aura::Window* window) { 420 const WindowState* GetWindowState(const aura::Window* window) {
421 return GetWindowState(const_cast<aura::Window*>(window)); 421 return GetWindowState(const_cast<aura::Window*>(window));
422 } 422 }
423 423
424 } // namespace wm 424 } // namespace wm
425 } // namespace ash 425 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_positioner.cc ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698