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

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

Issue 169713003: Remove WindowState::IsNormalShowState() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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_state.cc ('k') | ash/wm/workspace/snap_sizer_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_util.h" 5 #include "ash/wm/window_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 bool CanActivateWindow(aura::Window* window) { 51 bool CanActivateWindow(aura::Window* window) {
52 return views::corewm::CanActivateWindow(window); 52 return views::corewm::CanActivateWindow(window);
53 } 53 }
54 54
55 bool IsWindowMinimized(aura::Window* window) { 55 bool IsWindowMinimized(aura::Window* window) {
56 return ash::wm::GetWindowState(window)->IsMinimized(); 56 return ash::wm::GetWindowState(window)->IsMinimized();
57 } 57 }
58 58
59 void CenterWindow(aura::Window* window) { 59 void CenterWindow(aura::Window* window) {
60 wm::WindowState* window_state = wm::GetWindowState(window); 60 wm::WindowState* window_state = wm::GetWindowState(window);
61 if (!window_state->IsNormalShowState()) 61 if (!window_state->IsNormalOrSnapped())
62 return; 62 return;
63 const gfx::Display display = 63 const gfx::Display display =
64 Shell::GetScreen()->GetDisplayNearestWindow(window); 64 Shell::GetScreen()->GetDisplayNearestWindow(window);
65 gfx::Rect center = display.work_area(); 65 gfx::Rect center = display.work_area();
66 gfx::Size size = window->bounds().size(); 66 gfx::Size size = window->bounds().size();
67 if (window_state->IsSnapped()) { 67 if (window_state->IsSnapped()) {
68 if (window_state->HasRestoreBounds()) 68 if (window_state->HasRestoreBounds())
69 size = window_state->GetRestoreBoundsInScreen().size(); 69 size = window_state->GetRestoreBoundsInScreen().size();
70 center.ClampToCenteredSize(size); 70 center.ClampToCenteredSize(size);
71 window_state->SetRestoreBoundsInScreen(center); 71 window_state->SetRestoreBoundsInScreen(center);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 ++i) { 143 ++i) {
144 ReparentChildWithTransientChildren( 144 ReparentChildWithTransientChildren(
145 views::corewm::GetTransientChildren(child)[i], 145 views::corewm::GetTransientChildren(child)[i],
146 old_parent, 146 old_parent,
147 new_parent); 147 new_parent);
148 } 148 }
149 } 149 }
150 150
151 } // namespace wm 151 } // namespace wm
152 } // namespace ash 152 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_state.cc ('k') | ash/wm/workspace/snap_sizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698