| 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/activation_controller.h" | 5 #include "ash/wm/activation_controller.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_modality_controller.h" | 9 #include "ash/wm/window_modality_controller.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace internal { | 21 namespace internal { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // These are the list of container ids of containers which may contain windows | 24 // These are the list of container ids of containers which may contain windows |
| 25 // that need to be activated in the order that they should be activated. | 25 // that need to be activated in the order that they should be activated. |
| 26 const int kWindowContainerIds[] = { | 26 const int kWindowContainerIds[] = { |
| 27 kShellWindowId_LockSystemModalContainer, | 27 kShellWindowId_LockSystemModalContainer, |
| 28 kShellWindowId_LockScreenContainer, | 28 kShellWindowId_LockScreenContainer, |
| 29 kShellWindowId_SystemModalContainer, | 29 kShellWindowId_SystemModalContainer, |
| 30 kShellWindowId_AlwaysOnTopContainer, | 30 kShellWindowId_AlwaysOnTopContainer, |
| 31 kShellWindowId_SettingBubbleContainer, |
| 31 kShellWindowId_DefaultContainer, | 32 kShellWindowId_DefaultContainer, |
| 32 | 33 |
| 33 // Panel, launcher and status are intentionally checked after other | 34 // Panel, launcher and status are intentionally checked after other |
| 34 // containers even though these layers are higher. The user expects their | 35 // containers even though these layers are higher. The user expects their |
| 35 // windows to be focused before these elements. | 36 // windows to be focused before these elements. |
| 36 kShellWindowId_PanelContainer, | 37 kShellWindowId_PanelContainer, |
| 37 kShellWindowId_LauncherContainer, | 38 kShellWindowId_LauncherContainer, |
| 38 kShellWindowId_StatusContainer, | 39 kShellWindowId_StatusContainer, |
| 39 kShellWindowId_SettingBubbleContainer, | |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 aura::Window* GetContainer(int id) { | 42 aura::Window* GetContainer(int id) { |
| 43 return Shell::GetInstance()->GetContainer(id); | 43 return Shell::GetInstance()->GetContainer(id); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // Returns true if children of |window| can be activated. | 46 // Returns true if children of |window| can be activated. |
| 47 // These are the only containers in which windows can receive focus. | 47 // These are the only containers in which windows can receive focus. |
| 48 bool SupportsChildActivation(aura::Window* window) { | 48 bool SupportsChildActivation(aura::Window* window) { |
| 49 for (size_t i = 0; i < arraysize(kWindowContainerIds); i++) { | 49 for (size_t i = 0; i < arraysize(kWindowContainerIds); i++) { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 i != container->children().rend(); | 253 i != container->children().rend(); |
| 254 ++i) { | 254 ++i) { |
| 255 if (*i != ignore && CanActivateWindow(*i)) | 255 if (*i != ignore && CanActivateWindow(*i)) |
| 256 return *i; | 256 return *i; |
| 257 } | 257 } |
| 258 return NULL; | 258 return NULL; |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace internal | 261 } // namespace internal |
| 262 } // namespace ash | 262 } // namespace ash |
| OLD | NEW |