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/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 namespace { | 163 namespace { |
164 | 164 |
165 using aura::Window; | 165 using aura::Window; |
166 using views::Widget; | 166 using views::Widget; |
167 | 167 |
168 // Returns the display id corresponding to window, or |GetTargetDisplayId()| | 168 // Returns the display id corresponding to window, or |GetTargetDisplayId()| |
169 // if |window| is null. | 169 // if |window| is null. |
170 int64_t GetDisplayIdForWindow(aura::Window* window) { | 170 int64_t GetDisplayIdForWindow(aura::Window* window) { |
171 if (!window) | 171 if (!window) |
172 return Shell::GetTargetDisplayId(); | 172 return Shell::GetTargetDisplayId(); |
173 return gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).id(); | 173 return display::Screen::GetScreen()->GetDisplayNearestWindow(window).id(); |
174 } | 174 } |
175 | 175 |
176 // A Corewm VisibilityController subclass that calls the Ash animation routine | 176 // A Corewm VisibilityController subclass that calls the Ash animation routine |
177 // so we can pick up our extended animations. See ash/wm/window_animations.h. | 177 // so we can pick up our extended animations. See ash/wm/window_animations.h. |
178 class AshVisibilityController : public ::wm::VisibilityController { | 178 class AshVisibilityController : public ::wm::VisibilityController { |
179 public: | 179 public: |
180 AshVisibilityController() {} | 180 AshVisibilityController() {} |
181 ~AshVisibilityController() override {} | 181 ~AshVisibilityController() override {} |
182 | 182 |
183 private: | 183 private: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 aura::Window* Shell::GetTargetRootWindow() { | 257 aura::Window* Shell::GetTargetRootWindow() { |
258 CHECK(HasInstance()); | 258 CHECK(HasInstance()); |
259 Shell* shell = GetInstance(); | 259 Shell* shell = GetInstance(); |
260 if (shell->scoped_target_root_window_) | 260 if (shell->scoped_target_root_window_) |
261 return shell->scoped_target_root_window_; | 261 return shell->scoped_target_root_window_; |
262 return shell->target_root_window_; | 262 return shell->target_root_window_; |
263 } | 263 } |
264 | 264 |
265 // static | 265 // static |
266 int64_t Shell::GetTargetDisplayId() { | 266 int64_t Shell::GetTargetDisplayId() { |
267 return gfx::Screen::GetScreen() | 267 return display::Screen::GetScreen() |
268 ->GetDisplayNearestWindow(GetTargetRootWindow()) | 268 ->GetDisplayNearestWindow(GetTargetRootWindow()) |
269 .id(); | 269 .id(); |
270 } | 270 } |
271 | 271 |
272 // static | 272 // static |
273 aura::Window::Windows Shell::GetAllRootWindows() { | 273 aura::Window::Windows Shell::GetAllRootWindows() { |
274 CHECK(HasInstance()); | 274 CHECK(HasInstance()); |
275 return Shell::GetInstance()->window_tree_host_manager()->GetAllRootWindows(); | 275 return Shell::GetInstance()->window_tree_host_manager()->GetAllRootWindows(); |
276 } | 276 } |
277 | 277 |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 | 1261 |
1262 void Shell::OnWindowActivated( | 1262 void Shell::OnWindowActivated( |
1263 aura::client::ActivationChangeObserver::ActivationReason reason, | 1263 aura::client::ActivationChangeObserver::ActivationReason reason, |
1264 aura::Window* gained_active, | 1264 aura::Window* gained_active, |
1265 aura::Window* lost_active) { | 1265 aura::Window* lost_active) { |
1266 if (gained_active) | 1266 if (gained_active) |
1267 target_root_window_ = gained_active->GetRootWindow(); | 1267 target_root_window_ = gained_active->GetRootWindow(); |
1268 } | 1268 } |
1269 | 1269 |
1270 } // namespace ash | 1270 } // namespace ash |
OLD | NEW |