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 17 matching lines...) Expand all Loading... |
28 // Returns true if children of |window| can be activated. | 28 // Returns true if children of |window| can be activated. |
29 // These are the only containers in which windows can receive focus. | 29 // These are the only containers in which windows can receive focus. |
30 bool SupportsChildActivation(aura::Window* window) { | 30 bool SupportsChildActivation(aura::Window* window) { |
31 return window->id() == kShellWindowId_DefaultContainer || | 31 return window->id() == kShellWindowId_DefaultContainer || |
32 window->id() == kShellWindowId_AlwaysOnTopContainer || | 32 window->id() == kShellWindowId_AlwaysOnTopContainer || |
33 window->id() == kShellWindowId_PanelContainer || | 33 window->id() == kShellWindowId_PanelContainer || |
34 window->id() == kShellWindowId_SystemModalContainer || | 34 window->id() == kShellWindowId_SystemModalContainer || |
35 window->id() == kShellWindowId_StatusContainer || | 35 window->id() == kShellWindowId_StatusContainer || |
36 window->id() == kShellWindowId_LauncherContainer || | 36 window->id() == kShellWindowId_LauncherContainer || |
37 window->id() == kShellWindowId_LockScreenContainer || | 37 window->id() == kShellWindowId_LockScreenContainer || |
38 window->id() == kShellWindowId_LockSystemModalContainer; | 38 window->id() == kShellWindowId_LockSystemModalContainer || |
| 39 window->id() == kShellWindowId_SettingBubbleContainer; |
39 } | 40 } |
40 | 41 |
41 // Returns true if |window| can be activated or deactivated. | 42 // Returns true if |window| can be activated or deactivated. |
42 // A window manager typically defines some notion of "top level window" that | 43 // A window manager typically defines some notion of "top level window" that |
43 // supports activation/deactivation. | 44 // supports activation/deactivation. |
44 bool CanActivateWindow(aura::Window* window) { | 45 bool CanActivateWindow(aura::Window* window) { |
45 return window && | 46 return window && |
46 window->IsVisible() && | 47 window->IsVisible() && |
47 (!aura::client::GetActivationDelegate(window) || | 48 (!aura::client::GetActivationDelegate(window) || |
48 aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)) && | 49 aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)) && |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 ++i) { | 222 ++i) { |
222 if (*i != ignore && CanActivateWindow(*i)) | 223 if (*i != ignore && CanActivateWindow(*i)) |
223 return *i; | 224 return *i; |
224 } | 225 } |
225 } | 226 } |
226 return NULL; | 227 return NULL; |
227 } | 228 } |
228 | 229 |
229 } // namespace internal | 230 } // namespace internal |
230 } // namespace ash | 231 } // namespace ash |
OLD | NEW |