| 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_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return window->transient_parent() && | 49 return window->transient_parent() && |
| 50 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_WINDOW; | 50 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_WINDOW; |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 //////////////////////////////////////////////////////////////////////////////// | 55 //////////////////////////////////////////////////////////////////////////////// |
| 56 // StackingController, public: | 56 // StackingController, public: |
| 57 | 57 |
| 58 StackingController::StackingController() { | 58 StackingController::StackingController() { |
| 59 aura::client::SetStackingClient(this); | |
| 60 } | 59 } |
| 61 | 60 |
| 62 StackingController::~StackingController() { | 61 StackingController::~StackingController() { |
| 63 } | 62 } |
| 64 | 63 |
| 65 //////////////////////////////////////////////////////////////////////////////// | 64 //////////////////////////////////////////////////////////////////////////////// |
| 66 // StackingController, aura::StackingClient implementation: | 65 // StackingController, aura::StackingClient implementation: |
| 67 | 66 |
| 68 aura::Window* StackingController::GetDefaultParent(aura::Window* window, | 67 aura::Window* StackingController::GetDefaultParent(aura::Window* context, |
| 68 aura::Window* window, |
| 69 const gfx::Rect& bounds) { | 69 const gfx::Rect& bounds) { |
| 70 aura::RootWindow* target_root = NULL; | 70 aura::RootWindow* target_root = NULL; |
| 71 if (window->transient_parent()) { | 71 if (window->transient_parent()) { |
| 72 // Transient window should use the same root as its transient parent. | 72 // Transient window should use the same root as its transient parent. |
| 73 target_root = window->transient_parent()->GetRootWindow(); | 73 target_root = window->transient_parent()->GetRootWindow(); |
| 74 } else { | 74 } else { |
| 75 target_root = FindContainerRoot(bounds); | 75 target_root = FindContainerRoot(bounds); |
| 76 } | 76 } |
| 77 | 77 |
| 78 switch (window->type()) { | 78 switch (window->type()) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 root_window->GetChildById( | 148 root_window->GetChildById( |
| 149 internal::kShellWindowId_AlwaysOnTopContainer)); | 149 internal::kShellWindowId_AlwaysOnTopContainer)); |
| 150 // RootWindow owns the AlwaysOnTopController object. | 150 // RootWindow owns the AlwaysOnTopController object. |
| 151 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); | 151 root_window->SetProperty(kAlwaysOnTopControllerKey, controller); |
| 152 } | 152 } |
| 153 return controller; | 153 return controller; |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace internal | 156 } // namespace internal |
| 157 } // namespace ash | 157 } // namespace ash |
| OLD | NEW |