OLD | NEW |
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/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/activation_controller.h" | 10 #include "ash/wm/activation_controller.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 void MinimizeWindow(aura::Window* window) { | 95 void MinimizeWindow(aura::Window* window) { |
96 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); | 96 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
97 } | 97 } |
98 | 98 |
99 void RestoreWindow(aura::Window* window) { | 99 void RestoreWindow(aura::Window* window) { |
100 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 100 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
101 } | 101 } |
102 | 102 |
103 void CenterWindow(aura::Window* window) { | 103 void CenterWindow(aura::Window* window) { |
104 const gfx::Display display = gfx::Screen::GetDisplayNearestWindow(window); | 104 const gfx::Display display = |
| 105 Shell::GetAshScreen()->GetDisplayNearestWindow(window); |
105 gfx::Rect center = display.work_area().Center(window->bounds().size()); | 106 gfx::Rect center = display.work_area().Center(window->bounds().size()); |
106 window->SetBounds(center); | 107 window->SetBounds(center); |
107 } | 108 } |
108 | 109 |
109 ui::Layer* RecreateWindowLayers(aura::Window* window, bool set_bounds) { | 110 ui::Layer* RecreateWindowLayers(aura::Window* window, bool set_bounds) { |
110 const gfx::Rect bounds = window->bounds(); | 111 const gfx::Rect bounds = window->bounds(); |
111 ui::Layer* old_layer = window->RecreateLayer(); | 112 ui::Layer* old_layer = window->RecreateLayer(); |
112 DCHECK(old_layer); | 113 DCHECK(old_layer); |
113 for (aura::Window::Windows::const_iterator it = window->children().begin(); | 114 for (aura::Window::Windows::const_iterator it = window->children().begin(); |
114 it != window->children().end(); | 115 it != window->children().end(); |
(...skipping 12 matching lines...) Expand all Loading... |
127 it != children.end(); | 128 it != children.end(); |
128 ++it) { | 129 ++it) { |
129 ui::Layer* child = *it; | 130 ui::Layer* child = *it; |
130 DeepDeleteLayers(child); | 131 DeepDeleteLayers(child); |
131 } | 132 } |
132 delete layer; | 133 delete layer; |
133 } | 134 } |
134 | 135 |
135 } // namespace wm | 136 } // namespace wm |
136 } // namespace ash | 137 } // namespace ash |
OLD | NEW |