| 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_manager2.h" | 9 #include "ash/wm/workspace/workspace_manager.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "ui/aura/client/activation_client.h" | 11 #include "ui/aura/client/activation_client.h" |
| 12 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
| 13 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
| 14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 WorkspaceController::WorkspaceController(aura::Window* viewport) | 19 WorkspaceController::WorkspaceController(aura::Window* viewport) |
| 20 : viewport_(viewport) { | 20 : viewport_(viewport) { |
| 21 aura::RootWindow* root_window = viewport->GetRootWindow(); | 21 aura::RootWindow* root_window = viewport->GetRootWindow(); |
| 22 workspace_manager_.reset(new WorkspaceManager2(viewport)); | 22 workspace_manager_.reset(new WorkspaceManager(viewport)); |
| 23 aura::client::GetActivationClient(root_window)->AddObserver(this); | 23 aura::client::GetActivationClient(root_window)->AddObserver(this); |
| 24 } | 24 } |
| 25 | 25 |
| 26 WorkspaceController::~WorkspaceController() { | 26 WorkspaceController::~WorkspaceController() { |
| 27 aura::client::GetActivationClient(viewport_->GetRootWindow())-> | 27 aura::client::GetActivationClient(viewport_->GetRootWindow())-> |
| 28 RemoveObserver(this); | 28 RemoveObserver(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 WorkspaceWindowState WorkspaceController::GetWindowState() const { | 31 WorkspaceWindowState WorkspaceController::GetWindowState() const { |
| 32 return workspace_manager_->GetWindowState(); | 32 return workspace_manager_->GetWindowState(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 void WorkspaceController::OnWindowActivated(aura::Window* window, | 52 void WorkspaceController::OnWindowActivated(aura::Window* window, |
| 53 aura::Window* old_active) { | 53 aura::Window* old_active) { |
| 54 if (!window || window->GetRootWindow() == viewport_->GetRootWindow()) | 54 if (!window || window->GetRootWindow() == viewport_->GetRootWindow()) |
| 55 workspace_manager_->SetActiveWorkspaceByWindow(window); | 55 workspace_manager_->SetActiveWorkspaceByWindow(window); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace internal | 58 } // namespace internal |
| 59 } // namespace ash | 59 } // namespace ash |
| OLD | NEW |