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/stacking_controller.h" | 5 #include "ash/wm/stacking_controller.h" |
6 | 6 |
7 #include "ash/monitor/monitor_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/always_on_top_controller.h" | 10 #include "ash/wm/always_on_top_controller.h" |
11 #include "ash/wm/window_properties.h" | 11 #include "ash/wm/window_properties.h" |
12 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
13 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/base/ui_base_types.h" | 15 #include "ui/base/ui_base_types.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 namespace internal { | 18 namespace internal { |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Find a root window that matches the |bounds|. If the virtual screen | 21 // Find a root window that matches the |bounds|. If the virtual screen |
22 // coordinates is enabled and the bounds is specified, the root window | 22 // coordinates is enabled and the bounds is specified, the root window |
23 // that matches the window's bound will be used. Otherwise, it'll | 23 // that matches the window's bound will be used. Otherwise, it'll |
24 // return the active root window. | 24 // return the active root window. |
25 aura::RootWindow* FindContainerRoot(const gfx::Rect& bounds) { | 25 aura::RootWindow* FindContainerRoot(const gfx::Rect& bounds) { |
26 if (!MonitorController::IsVirtualScreenCoordinatesEnabled() || | 26 if (!DisplayController::IsVirtualScreenCoordinatesEnabled() || |
27 (bounds.origin().x() == 0 && bounds.origin().y() == 0 | 27 (bounds.origin().x() == 0 && bounds.origin().y() == 0 |
28 && bounds.IsEmpty())) { | 28 && bounds.IsEmpty())) { |
29 return Shell::GetActiveRootWindow(); | 29 return Shell::GetActiveRootWindow(); |
30 } | 30 } |
31 return Shell::GetRootWindowMatching(bounds); | 31 return Shell::GetRootWindowMatching(bounds); |
32 } | 32 } |
33 | 33 |
34 aura::Window* GetContainerById(const gfx::Rect& bounds, int id) { | 34 aura::Window* GetContainerById(const gfx::Rect& bounds, int id) { |
35 return Shell::GetContainer(FindContainerRoot(bounds), id); | 35 return Shell::GetContainer(FindContainerRoot(bounds), id); |
36 } | 36 } |
(...skipping 104 matching lines...) Loading... |
141 root_window->GetChildById( | 141 root_window->GetChildById( |
142 internal::kShellWindowId_AlwaysOnTopContainer)); | 142 internal::kShellWindowId_AlwaysOnTopContainer)); |
143 // RootWindow owns the AlwaysOnTopController object. | 143 // RootWindow owns the AlwaysOnTopController object. |
144 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); | 144 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); |
145 } | 145 } |
146 return controller; | 146 return controller; |
147 } | 147 } |
148 | 148 |
149 } // namespace internal | 149 } // namespace internal |
150 } // namespace ash | 150 } // namespace ash |
OLD | NEW |