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/workspace_manager.h" | 5 #include "ash/wm/workspace/workspace_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 workspace->RemoveWindow(window); | 127 workspace->RemoveWindow(window); |
128 CleanupWorkspace(workspace); | 128 CleanupWorkspace(workspace); |
129 } | 129 } |
130 | 130 |
131 void WorkspaceManager::SetActiveWorkspaceByWindow(aura::Window* window) { | 131 void WorkspaceManager::SetActiveWorkspaceByWindow(aura::Window* window) { |
132 Workspace* workspace = FindBy(window); | 132 Workspace* workspace = FindBy(window); |
133 if (workspace) | 133 if (workspace) |
134 workspace->Activate(); | 134 workspace->Activate(); |
135 } | 135 } |
136 | 136 |
| 137 void WorkspaceManager::SetGridSize(int grid_size) { |
| 138 grid_size_ = grid_size; |
| 139 } |
| 140 |
137 void WorkspaceManager::UpdateShelfVisibility() { | 141 void WorkspaceManager::UpdateShelfVisibility() { |
138 if (shelf_) | 142 if (shelf_) |
139 shelf_->UpdateVisibilityState(); | 143 shelf_->UpdateVisibilityState(); |
140 } | 144 } |
141 | 145 |
142 WorkspaceWindowState WorkspaceManager::GetWindowState() const { | 146 WorkspaceWindowState WorkspaceManager::GetWindowState() const { |
143 if (!shelf_ || !active_workspace_) | 147 if (!shelf_ || !active_workspace_) |
144 return WORKSPACE_WINDOW_STATE_DEFAULT; | 148 return WORKSPACE_WINDOW_STATE_DEFAULT; |
145 | 149 |
146 // TODO: this code needs to be made multi-display aware. | 150 // TODO: this code needs to be made multi-display aware. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 return workspace; | 352 return workspace; |
349 } | 353 } |
350 | 354 |
351 void WorkspaceManager::CleanupWorkspace(Workspace* workspace) { | 355 void WorkspaceManager::CleanupWorkspace(Workspace* workspace) { |
352 if (workspace->type() != Workspace::TYPE_MANAGED && workspace->is_empty()) | 356 if (workspace->type() != Workspace::TYPE_MANAGED && workspace->is_empty()) |
353 delete workspace; | 357 delete workspace; |
354 } | 358 } |
355 | 359 |
356 } // namespace internal | 360 } // namespace internal |
357 } // namespace ash | 361 } // namespace ash |
OLD | NEW |