Chromium Code Reviews| 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/session_state_delegate.h" | 8 #include "ash/session_state_delegate.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/always_on_top_controller.h" | 11 #include "ash/wm/always_on_top_controller.h" |
| 12 #include "ash/wm/coordinate_conversion.h" | 12 #include "ash/wm/coordinate_conversion.h" |
| 13 #include "ash/wm/property_util.h" | |
| 13 #include "ash/wm/window_properties.h" | 14 #include "ash/wm/window_properties.h" |
| 14 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
| 15 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/base/ui_base_types.h" | 18 #include "ui/base/ui_base_types.h" |
| 18 | 19 |
| 19 namespace ash { | 20 namespace ash { |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 // Find a root window that matches the |bounds|. If the virtual screen | 23 // Find a root window that matches the |bounds|. If the virtual screen |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 target_root = FindContainerRoot(bounds); | 79 target_root = FindContainerRoot(bounds); |
| 79 } | 80 } |
| 80 | 81 |
| 81 switch (window->type()) { | 82 switch (window->type()) { |
| 82 case aura::client::WINDOW_TYPE_NORMAL: | 83 case aura::client::WINDOW_TYPE_NORMAL: |
| 83 case aura::client::WINDOW_TYPE_POPUP: | 84 case aura::client::WINDOW_TYPE_POPUP: |
| 84 if (IsSystemModal(window)) | 85 if (IsSystemModal(window)) |
| 85 return GetSystemModalContainer(target_root, window); | 86 return GetSystemModalContainer(target_root, window); |
| 86 else if (HasTransientParentWindow(window)) | 87 else if (HasTransientParentWindow(window)) |
| 87 return GetContainerForWindow(window->transient_parent()); | 88 return GetContainerForWindow(window->transient_parent()); |
| 89 else if (IsWindowDocked(window)) | |
| 90 return GetContainerById(target_root, | |
| 91 internal::kShellWindowId_DockContainer); | |
|
flackr
2013/06/11 17:59:31
nit: multi-line block requires curlies {}
varkha
2013/06/12 04:52:13
Eliminating the window property made this piece un
| |
| 88 return GetAlwaysOnTopController(target_root)->GetContainer(window); | 92 return GetAlwaysOnTopController(target_root)->GetContainer(window); |
| 89 case aura::client::WINDOW_TYPE_CONTROL: | 93 case aura::client::WINDOW_TYPE_CONTROL: |
| 90 return GetContainerById( | 94 return GetContainerById( |
| 91 target_root, internal::kShellWindowId_UnparentedControlContainer); | 95 target_root, internal::kShellWindowId_UnparentedControlContainer); |
| 92 case aura::client::WINDOW_TYPE_PANEL: | 96 case aura::client::WINDOW_TYPE_PANEL: |
| 93 if (IsPanelAttached(window)) | 97 if (IsPanelAttached(window)) |
| 94 return GetContainerById(target_root, | 98 return GetContainerById(target_root, |
| 95 internal::kShellWindowId_PanelContainer); | 99 internal::kShellWindowId_PanelContainer); |
| 100 else if (IsWindowDocked(window)) | |
| 101 return GetContainerById(target_root, | |
| 102 internal::kShellWindowId_DockContainer); | |
| 96 else | 103 else |
| 97 return GetAlwaysOnTopController(target_root)->GetContainer(window); | 104 return GetAlwaysOnTopController(target_root)->GetContainer(window); |
| 98 case aura::client::WINDOW_TYPE_MENU: | 105 case aura::client::WINDOW_TYPE_MENU: |
| 99 return GetContainerById( | 106 return GetContainerById( |
| 100 target_root, internal::kShellWindowId_MenuContainer); | 107 target_root, internal::kShellWindowId_MenuContainer); |
| 101 case aura::client::WINDOW_TYPE_TOOLTIP: | 108 case aura::client::WINDOW_TYPE_TOOLTIP: |
| 102 return GetContainerById( | 109 return GetContainerById( |
| 103 target_root, internal::kShellWindowId_DragImageAndTooltipContainer); | 110 target_root, internal::kShellWindowId_DragImageAndTooltipContainer); |
| 104 default: | 111 default: |
| 105 NOTREACHED() << "Window " << window->id() | 112 NOTREACHED() << "Window " << window->id() |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 controller->SetAlwaysOnTopContainer( | 162 controller->SetAlwaysOnTopContainer( |
| 156 root_window->GetChildById( | 163 root_window->GetChildById( |
| 157 internal::kShellWindowId_AlwaysOnTopContainer)); | 164 internal::kShellWindowId_AlwaysOnTopContainer)); |
| 158 // RootWindow owns the AlwaysOnTopController object. | 165 // RootWindow owns the AlwaysOnTopController object. |
| 159 root_window->SetProperty(internal::kAlwaysOnTopControllerKey, controller); | 166 root_window->SetProperty(internal::kAlwaysOnTopControllerKey, controller); |
| 160 } | 167 } |
| 161 return controller; | 168 return controller; |
| 162 } | 169 } |
| 163 | 170 |
| 164 } // namespace ash | 171 } // namespace ash |
| OLD | NEW |