| 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/ash_focus_rules.h" | 5 #include "ash/wm/ash_focus_rules.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 namespace wm { | 13 namespace wm { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // These are the list of container ids of containers which may contain windows | 16 // These are the list of container ids of containers which may contain windows |
| 17 // that need to be activated in the order that they should be activated. | 17 // that need to be activated in the order that they should be activated. |
| 18 const int kWindowContainerIds[] = { | 18 const int kWindowContainerIds[] = { |
| 19 internal::kShellWindowId_LockSystemModalContainer, | 19 internal::kShellWindowId_LockSystemModalContainer, |
| 20 internal::kShellWindowId_SettingBubbleContainer, | 20 internal::kShellWindowId_SettingBubbleContainer, |
| 21 internal::kShellWindowId_LockScreenContainer, | 21 internal::kShellWindowId_LockScreenContainer, |
| 22 internal::kShellWindowId_SystemModalContainer, | 22 internal::kShellWindowId_SystemModalContainer, |
| 23 internal::kShellWindowId_AlwaysOnTopContainer, | 23 internal::kShellWindowId_AlwaysOnTopContainer, |
| 24 internal::kShellWindowId_AppListContainer, | 24 internal::kShellWindowId_AppListContainer, |
| 25 internal::kShellWindowId_DefaultContainer, | 25 internal::kShellWindowId_DefaultContainer, |
| 26 | 26 |
| 27 // Panel, launcher and status are intentionally checked after other | 27 // Docked, panel, launcher and status are intentionally checked after other |
| 28 // containers even though these layers are higher. The user expects their | 28 // containers even though these layers are higher. The user expects their |
| 29 // windows to be focused before these elements. | 29 // windows to be focused before these elements. |
| 30 internal::kShellWindowId_DockedContainer, |
| 30 internal::kShellWindowId_PanelContainer, | 31 internal::kShellWindowId_PanelContainer, |
| 31 internal::kShellWindowId_ShelfContainer, | 32 internal::kShellWindowId_ShelfContainer, |
| 32 internal::kShellWindowId_StatusContainer, | 33 internal::kShellWindowId_StatusContainer, |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 bool BelongsToContainerWithEqualOrGreaterId(const aura::Window* window, | 36 bool BelongsToContainerWithEqualOrGreaterId(const aura::Window* window, |
| 36 int container_id) { | 37 int container_id) { |
| 37 for (; window; window = window->parent()) { | 38 for (; window; window = window->parent()) { |
| 38 if (window->id() >= container_id) | 39 if (window->id() >= container_id) |
| 39 return true; | 40 return true; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 i != container->children().rend(); | 172 i != container->children().rend(); |
| 172 ++i) { | 173 ++i) { |
| 173 if (*i != ignore && CanActivateWindow(*i) && !wm::IsWindowMinimized(*i)) | 174 if (*i != ignore && CanActivateWindow(*i) && !wm::IsWindowMinimized(*i)) |
| 174 return *i; | 175 return *i; |
| 175 } | 176 } |
| 176 return NULL; | 177 return NULL; |
| 177 } | 178 } |
| 178 | 179 |
| 179 } // namespace wm | 180 } // namespace wm |
| 180 } // namespace ash | 181 } // namespace ash |
| OLD | NEW |