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/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
8 #include "ash/wm/workspace/workspace_event_filter.h" | 8 #include "ash/wm/workspace/workspace_event_filter.h" |
9 #include "ash/wm/workspace/workspace_layout_manager.h" | 9 #include "ash/wm/workspace/workspace_layout_manager.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 WorkspaceController::~WorkspaceController() { | 41 WorkspaceController::~WorkspaceController() { |
42 aura::client::GetActivationClient(viewport_->GetRootWindow())-> | 42 aura::client::GetActivationClient(viewport_->GetRootWindow())-> |
43 RemoveObserver(this); | 43 RemoveObserver(this); |
44 // WorkspaceLayoutManager may attempt to access state from us. Destroy it now. | 44 // WorkspaceLayoutManager may attempt to access state from us. Destroy it now. |
45 if (viewport_->layout_manager() == layout_manager_) | 45 if (viewport_->layout_manager() == layout_manager_) |
46 viewport_->SetLayoutManager(NULL); | 46 viewport_->SetLayoutManager(NULL); |
47 } | 47 } |
48 | 48 |
| 49 bool WorkspaceController::IsInMaximizedMode() const { |
| 50 return workspace_manager_->IsInMaximizedMode(); |
| 51 } |
| 52 |
49 void WorkspaceController::SetGridSize(int grid_size) { | 53 void WorkspaceController::SetGridSize(int grid_size) { |
50 workspace_manager_->set_grid_size(grid_size); | 54 workspace_manager_->set_grid_size(grid_size); |
51 event_filter_->set_grid_size(grid_size); | 55 event_filter_->set_grid_size(grid_size); |
52 } | 56 } |
53 | 57 |
| 58 int WorkspaceController::GetGridSize() const { |
| 59 return workspace_manager_->grid_size(); |
| 60 } |
| 61 |
| 62 WorkspaceWindowState WorkspaceController::GetWindowState() const { |
| 63 return workspace_manager_->GetWindowState(); |
| 64 } |
| 65 |
| 66 void WorkspaceController::SetShelf(ShelfLayoutManager* shelf) { |
| 67 workspace_manager_->set_shelf(shelf); |
| 68 } |
| 69 |
54 void WorkspaceController::OnWindowActivated(aura::Window* window, | 70 void WorkspaceController::OnWindowActivated(aura::Window* window, |
55 aura::Window* old_active) { | 71 aura::Window* old_active) { |
56 workspace_manager_->SetActiveWorkspaceByWindow(window); | 72 workspace_manager_->SetActiveWorkspaceByWindow(window); |
57 } | 73 } |
58 | 74 |
59 } // namespace internal | 75 } // namespace internal |
60 } // namespace ash | 76 } // namespace ash |
OLD | NEW |