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/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | |
| 7 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
| 8 #include "ash/wm/workspace/workspace_manager.h" | 9 #include "ash/wm/workspace/workspace_manager.h" |
| 9 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
| 11 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
| 12 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 13 | 14 |
| 14 namespace ash { | 15 namespace ash { |
| 15 namespace internal { | 16 namespace internal { |
| 16 | 17 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 } | 52 } |
| 52 | 53 |
| 53 void WorkspaceController::OnWindowActivated(aura::Window* gained_active, | 54 void WorkspaceController::OnWindowActivated(aura::Window* gained_active, |
| 54 aura::Window* lost_active) { | 55 aura::Window* lost_active) { |
| 55 if (!gained_active || | 56 if (!gained_active || |
| 56 gained_active->GetRootWindow() == viewport_->GetRootWindow()) { | 57 gained_active->GetRootWindow() == viewport_->GetRootWindow()) { |
| 57 workspace_manager_->SetActiveWorkspaceByWindow(gained_active); | 58 workspace_manager_->SetActiveWorkspaceByWindow(gained_active); |
| 58 } | 59 } |
| 59 } | 60 } |
| 60 | 61 |
| 62 void WorkspaceController::OnAttemptToReactivateWindow( | |
| 63 aura::Window* request_active, aura::Window* actual_active) { | |
|
sky
2013/04/23 21:36:42
same comment here.
sschmitz
2013/04/24 01:23:43
Done.
| |
| 64 if (!request_active || request_active == actual_active) | |
|
sky
2013/04/23 21:36:42
Do we really pass in NULL in some case?
sschmitz
2013/04/24 01:23:43
Not anymore.
Done.
| |
| 65 return; | |
| 66 if (ash::Shell::GetInstance()->IsSystemModalWindowOpen()) { | |
| 67 // Handle the case that the requested window was not activated because | |
|
sky
2013/04/23 21:36:42
How about something like:
While a system model dia
sschmitz
2013/04/24 01:23:43
Done.
| |
| 68 // of a system model window. We still want to activate the workspace | |
| 69 // of the requested window. | |
| 70 workspace_manager_->SetActiveWorkspaceByWindow(request_active); | |
| 71 } | |
| 72 } | |
| 73 | |
| 61 } // namespace internal | 74 } // namespace internal |
| 62 } // namespace ash | 75 } // namespace ash |
| OLD | NEW |