| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
| 9 #include "ash/wm/workspace/workspace_cycler.h" | 9 #include "ash/wm/workspace/workspace_cycler.h" |
| 10 #include "ash/wm/workspace/workspace_manager.h" | 10 #include "ash/wm/workspace/workspace_manager.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 void WorkspaceController::SetShelf(ShelfLayoutManager* shelf) { | 41 void WorkspaceController::SetShelf(ShelfLayoutManager* shelf) { |
| 42 workspace_manager_->SetShelf(shelf); | 42 workspace_manager_->SetShelf(shelf); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void WorkspaceController::SetActiveWorkspaceByWindow(aura::Window* window) { | 45 void WorkspaceController::SetActiveWorkspaceByWindow(aura::Window* window) { |
| 46 return workspace_manager_->SetActiveWorkspaceByWindow(window); | 46 return workspace_manager_->SetActiveWorkspaceByWindow(window); |
| 47 } | 47 } |
| 48 | 48 |
| 49 Workspace* WorkspaceController::GetActiveWorkspace() const { |
| 50 return workspace_manager_->active_workspace(); |
| 51 } |
| 52 |
| 49 aura::Window* WorkspaceController::GetParentForNewWindow(aura::Window* window) { | 53 aura::Window* WorkspaceController::GetParentForNewWindow(aura::Window* window) { |
| 50 return workspace_manager_->GetParentForNewWindow(window); | 54 return workspace_manager_->GetParentForNewWindow(window); |
| 51 } | 55 } |
| 52 | 56 |
| 53 | |
| 54 void WorkspaceController::DoInitialAnimation() { | 57 void WorkspaceController::DoInitialAnimation() { |
| 55 workspace_manager_->DoInitialAnimation(); | 58 workspace_manager_->DoInitialAnimation(); |
| 56 } | 59 } |
| 57 | 60 |
| 58 void WorkspaceController::OnWindowActivated(aura::Window* gained_active, | 61 void WorkspaceController::OnWindowActivated(aura::Window* gained_active, |
| 59 aura::Window* lost_active) { | 62 aura::Window* lost_active) { |
| 60 if (!gained_active || | 63 if (!gained_active || |
| 61 gained_active->GetRootWindow() == viewport_->GetRootWindow()) { | 64 gained_active->GetRootWindow() == viewport_->GetRootWindow()) { |
| 62 workspace_manager_->SetActiveWorkspaceByWindow(gained_active); | 65 workspace_manager_->SetActiveWorkspaceByWindow(gained_active); |
| 63 } | 66 } |
| 64 } | 67 } |
| 65 | 68 |
| 66 } // namespace internal | 69 } // namespace internal |
| 67 } // namespace ash | 70 } // namespace ash |
| OLD | NEW |