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/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 22 matching lines...) Expand all Loading... | |
| 33 window->id() == kShellWindowId_ModalContainer || | 33 window->id() == kShellWindowId_ModalContainer || |
| 34 window->id() == kShellWindowId_LockScreenContainer || | 34 window->id() == kShellWindowId_LockScreenContainer || |
| 35 window->id() == kShellWindowId_LockModalContainer; | 35 window->id() == kShellWindowId_LockModalContainer; |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Returns true if |window| can be activated or deactivated. | 38 // Returns true if |window| can be activated or deactivated. |
| 39 // A window manager typically defines some notion of "top level window" that | 39 // A window manager typically defines some notion of "top level window" that |
| 40 // supports activation/deactivation. | 40 // supports activation/deactivation. |
| 41 bool CanActivateWindow(aura::Window* window) { | 41 bool CanActivateWindow(aura::Window* window) { |
| 42 return window && | 42 return window && |
| 43 window->IsVisible() && | 43 window->CanReceiveEvents() && |
|
sky
2012/01/12 21:11:36
One downside of this is that if the lock screen is
oshima
2012/01/12 21:32:50
good point. done.
| |
| 44 (!aura::client::GetActivationDelegate(window) || | 44 (!aura::client::GetActivationDelegate(window) || |
| 45 aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)) && | 45 aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)) && |
| 46 SupportsChildActivation(window->parent()); | 46 SupportsChildActivation(window->parent()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // When a modal window is activated, we bring its entire transient parent chain | 49 // When a modal window is activated, we bring its entire transient parent chain |
| 50 // to the front. This function must be called before the modal transient is | 50 // to the front. This function must be called before the modal transient is |
| 51 // stacked at the top to ensure correct stacking order. | 51 // stacked at the top to ensure correct stacking order. |
| 52 void StackTransientParentsBelowModalWindow(aura::Window* window) { | 52 void StackTransientParentsBelowModalWindow(aura::Window* window) { |
| 53 if (window->GetIntProperty(aura::client::kModalKey) != ui::MODAL_TYPE_WINDOW) | 53 if (window->GetIntProperty(aura::client::kModalKey) != ui::MODAL_TYPE_WINDOW) |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 i != container->children().rend(); | 204 i != container->children().rend(); |
| 205 ++i) { | 205 ++i) { |
| 206 if (*i != ignore && CanActivateWindow(*i)) | 206 if (*i != ignore && CanActivateWindow(*i)) |
| 207 return *i; | 207 return *i; |
| 208 } | 208 } |
| 209 return NULL; | 209 return NULL; |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace internal | 212 } // namespace internal |
| 213 } // namespace ash | 213 } // namespace ash |
| OLD | NEW |