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/display/display_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/coordinate_conversion.h" |
11 #include "ash/wm/window_properties.h" | 12 #include "ash/wm/window_properties.h" |
12 #include "ui/aura/client/aura_constants.h" | 13 #include "ui/aura/client/aura_constants.h" |
13 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
14 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
15 #include "ui/base/ui_base_types.h" | 16 #include "ui/base/ui_base_types.h" |
16 | 17 |
17 namespace ash { | 18 namespace ash { |
18 namespace internal { | 19 namespace internal { |
19 namespace { | 20 namespace { |
20 | 21 |
21 // Find a root window that matches the |bounds|. If the virtual screen | 22 // Find a root window that matches the |bounds|. If the virtual screen |
22 // coordinates is enabled and the bounds is specified, the root window | 23 // coordinates is enabled and the bounds is specified, the root window |
23 // that matches the window's bound will be used. Otherwise, it'll | 24 // that matches the window's bound will be used. Otherwise, it'll |
24 // return the active root window. | 25 // return the active root window. |
25 aura::RootWindow* FindContainerRoot(const gfx::Rect& bounds) { | 26 aura::RootWindow* FindContainerRoot(const gfx::Rect& bounds) { |
26 if (!DisplayController::IsExtendedDesktopEnabled() || | 27 if (!DisplayController::IsExtendedDesktopEnabled() || |
27 (bounds.origin().x() == 0 && bounds.origin().y() == 0 && | 28 (bounds.origin().x() == 0 && bounds.origin().y() == 0 && |
28 bounds.IsEmpty())) { | 29 bounds.IsEmpty())) { |
29 return Shell::GetActiveRootWindow(); | 30 return Shell::GetActiveRootWindow(); |
30 } | 31 } |
31 return Shell::GetRootWindowMatching(bounds); | 32 return wm::GetRootWindowMatching(bounds); |
32 } | 33 } |
33 | 34 |
34 aura::Window* GetContainerById(aura::RootWindow* root, int id) { | 35 aura::Window* GetContainerById(aura::RootWindow* root, int id) { |
35 return Shell::GetContainer(root, id); | 36 return Shell::GetContainer(root, id); |
36 } | 37 } |
37 | 38 |
38 aura::Window* GetContainerForWindow(aura::Window* window) { | 39 aura::Window* GetContainerForWindow(aura::Window* window) { |
39 aura::Window* container = window->parent(); | 40 aura::Window* container = window->parent(); |
40 while (container && container->type() != aura::client::WINDOW_TYPE_UNKNOWN) | 41 while (container && container->type() != aura::client::WINDOW_TYPE_UNKNOWN) |
41 container = container->parent(); | 42 container = container->parent(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 root_window->GetChildById( | 152 root_window->GetChildById( |
152 internal::kShellWindowId_AlwaysOnTopContainer)); | 153 internal::kShellWindowId_AlwaysOnTopContainer)); |
153 // RootWindow owns the AlwaysOnTopController object. | 154 // RootWindow owns the AlwaysOnTopController object. |
154 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); | 155 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); |
155 } | 156 } |
156 return controller; | 157 return controller; |
157 } | 158 } |
158 | 159 |
159 } // namespace internal | 160 } // namespace internal |
160 } // namespace ash | 161 } // namespace ash |
OLD | NEW |