| 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" |
| 11 #include "ash/wm/window_modality_controller.h" | |
| 12 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| 13 #include "ash/wm/workspace_controller.h" | 12 #include "ash/wm/workspace_controller.h" |
| 13 #include "ui/views/corewm/window_modality_controller.h" |
| 14 | 14 |
| 15 namespace ash { | 15 namespace ash { |
| 16 namespace internal { | 16 namespace internal { |
| 17 | 17 |
| 18 //////////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////////// |
| 19 // AshActivationController, public: | 19 // AshActivationController, public: |
| 20 | 20 |
| 21 AshActivationController::AshActivationController() { | 21 AshActivationController::AshActivationController() { |
| 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 = GetModalTransient(window); | 32 aura::Window* window_modal_transient = |
| 33 views::corewm::GetModalTransient(window); |
| 33 if (window_modal_transient) | 34 if (window_modal_transient) |
| 34 return window_modal_transient; | 35 return window_modal_transient; |
| 35 | 36 |
| 36 // Make sure the workspace manager switches to the workspace for window. | 37 // Make sure the workspace manager switches to the workspace for window. |
| 37 // Without this CanReceiveEvents() below returns false and activation never | 38 // Without this CanReceiveEvents() below returns false and activation never |
| 38 // changes. CanReceiveEvents() returns false if |window| isn't in the active | 39 // changes. CanReceiveEvents() returns false if |window| isn't in the active |
| 39 // workspace, in which case its parent is not visible. | 40 // 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 | 41 // 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. | 42 // issue, but will make animations trickier... Consider which one is better. |
| 42 if (window) { | 43 if (window) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 // Shell. | 63 // Shell. |
| 63 if (window) { | 64 if (window) { |
| 64 DCHECK(window->GetRootWindow()); | 65 DCHECK(window->GetRootWindow()); |
| 65 Shell::GetInstance()->set_active_root_window(window->GetRootWindow()); | 66 Shell::GetInstance()->set_active_root_window(window->GetRootWindow()); |
| 66 } | 67 } |
| 67 return window; | 68 return window; |
| 68 } | 69 } |
| 69 | 70 |
| 70 aura::Window* AshActivationController::WillFocusWindow( | 71 aura::Window* AshActivationController::WillFocusWindow( |
| 71 aura::Window* window) { | 72 aura::Window* window) { |
| 72 aura::Window* window_modal_transient = GetModalTransient(window); | 73 aura::Window* window_modal_transient = |
| 74 views::corewm::GetModalTransient(window); |
| 73 if (window_modal_transient) | 75 if (window_modal_transient) |
| 74 return window_modal_transient; | 76 return window_modal_transient; |
| 75 return window; | 77 return window; |
| 76 } | 78 } |
| 77 | 79 |
| 78 } // namespace internal | 80 } // namespace internal |
| 79 } // namespace ash | 81 } // namespace ash |
| OLD | NEW |