| 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_activation_controller.h" | 5 #include "ash/wm/ash_activation_controller.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/wm/activation_controller.h" | 9 #include "ash/wm/activation_controller.h" |
| 10 #include "ash/wm/property_util.h" | 10 #include "ash/wm/property_util.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 AshActivationController::~AshActivationController() { | 24 AshActivationController::~AshActivationController() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
| 28 // AshActivationController, ActivationControllerDelegate implementation: | 28 // AshActivationController, ActivationControllerDelegate implementation: |
| 29 | 29 |
| 30 aura::Window* AshActivationController::WillActivateWindow( | 30 aura::Window* AshActivationController::WillActivateWindow( |
| 31 aura::Window* window) { | 31 aura::Window* window) { |
| 32 aura::Window* window_modal_transient = wm::GetModalTransient(window); | 32 aura::Window* window_modal_transient = GetModalTransient(window); |
| 33 if (window_modal_transient) | 33 if (window_modal_transient) |
| 34 return window_modal_transient; | 34 return window_modal_transient; |
| 35 | 35 |
| 36 // Make sure the workspace manager switches to the workspace for window. | 36 // Make sure the workspace manager switches to the workspace for window. |
| 37 // Without this CanReceiveEvents() below returns false and activation never | 37 // Without this CanReceiveEvents() below returns false and activation never |
| 38 // changes. CanReceiveEvents() returns false if |window| isn't in the active | 38 // changes. CanReceiveEvents() returns false if |window| isn't in the active |
| 39 // workspace, in which case its parent is not visible. | 39 // workspace, in which case its parent is not visible. |
| 40 // TODO(sky): if I instead change the opacity of the parent this isn't an | 40 // TODO(sky): if I instead change the opacity of the parent this isn't an |
| 41 // issue, but will make animations trickier... Consider which one is better. | 41 // issue, but will make animations trickier... Consider which one is better. |
| 42 if (window) { | 42 if (window) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 // Shell. | 62 // Shell. |
| 63 if (window) { | 63 if (window) { |
| 64 DCHECK(window->GetRootWindow()); | 64 DCHECK(window->GetRootWindow()); |
| 65 Shell::GetInstance()->set_active_root_window(window->GetRootWindow()); | 65 Shell::GetInstance()->set_active_root_window(window->GetRootWindow()); |
| 66 } | 66 } |
| 67 return window; | 67 return window; |
| 68 } | 68 } |
| 69 | 69 |
| 70 aura::Window* AshActivationController::WillFocusWindow( | 70 aura::Window* AshActivationController::WillFocusWindow( |
| 71 aura::Window* window) { | 71 aura::Window* window) { |
| 72 aura::Window* window_modal_transient = wm::GetModalTransient(window); | 72 aura::Window* window_modal_transient = GetModalTransient(window); |
| 73 if (window_modal_transient) | 73 if (window_modal_transient) |
| 74 return window_modal_transient; | 74 return window_modal_transient; |
| 75 return window; | 75 return window; |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace internal | 78 } // namespace internal |
| 79 } // namespace ash | 79 } // namespace ash |
| OLD | NEW |