| 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/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 (!DisplayController::IsVirtualScreenCoordinatesEnabled() || | 26 if (!DisplayController::IsExtendedDesktopEnabled() || |
| 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(aura::RootWindow* root, int id) { | 34 aura::Window* GetContainerById(aura::RootWindow* root, int id) { |
| 35 return Shell::GetContainer(root, id); | 35 return Shell::GetContainer(root, id); |
| 36 } | 36 } |
| 37 | 37 |
| 38 aura::Window* GetContainerForWindow(aura::Window* window) { | 38 aura::Window* GetContainerForWindow(aura::Window* window) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 root_window->GetChildById( | 151 root_window->GetChildById( |
| 152 internal::kShellWindowId_AlwaysOnTopContainer)); | 152 internal::kShellWindowId_AlwaysOnTopContainer)); |
| 153 // RootWindow owns the AlwaysOnTopController object. | 153 // RootWindow owns the AlwaysOnTopController object. |
| 154 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); | 154 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); |
| 155 } | 155 } |
| 156 return controller; | 156 return controller; |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace internal | 159 } // namespace internal |
| 160 } // namespace ash | 160 } // namespace ash |
| OLD | NEW |