| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 OnTypeOfWorkspacedNeededChanged(window); | 141 OnTypeOfWorkspacedNeededChanged(window); |
| 142 } | 142 } |
| 143 UpdateShelfVisibility(); | 143 UpdateShelfVisibility(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool WorkspaceManager::IsInMaximizedMode() const { | 146 bool WorkspaceManager::IsInMaximizedMode() const { |
| 147 return active_workspace_ && | 147 return active_workspace_ && |
| 148 active_workspace_->type() == Workspace::TYPE_MAXIMIZED; | 148 active_workspace_->type() == Workspace::TYPE_MAXIMIZED; |
| 149 } | 149 } |
| 150 | 150 |
| 151 void WorkspaceManager::SetGridSize(int size) { | |
| 152 grid_size_ = size; | |
| 153 } | |
| 154 | |
| 155 int WorkspaceManager::GetGridSize() const { | |
| 156 return grid_size_; | |
| 157 } | |
| 158 | |
| 159 WorkspaceWindowState WorkspaceManager::GetWindowState() const { | 151 WorkspaceWindowState WorkspaceManager::GetWindowState() const { |
| 160 if (!shelf_ || !active_workspace_) | 152 if (!shelf_ || !active_workspace_) |
| 161 return WORKSPACE_WINDOW_STATE_DEFAULT; | 153 return WORKSPACE_WINDOW_STATE_DEFAULT; |
| 162 | 154 |
| 163 // TODO: this code needs to be made multi-display aware. | 155 // TODO: this code needs to be made multi-display aware. |
| 164 gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); | 156 gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); |
| 165 const aura::Window::Windows& windows(contents_view_->children()); | 157 const aura::Window::Windows& windows(contents_view_->children()); |
| 166 bool window_overlaps_launcher = false; | 158 bool window_overlaps_launcher = false; |
| 167 bool has_maximized_window = false; | 159 bool has_maximized_window = false; |
| 168 for (aura::Window::Windows::const_iterator i = windows.begin(); | 160 for (aura::Window::Windows::const_iterator i = windows.begin(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 return workspace; | 359 return workspace; |
| 368 } | 360 } |
| 369 | 361 |
| 370 void WorkspaceManager::CleanupWorkspace(Workspace* workspace) { | 362 void WorkspaceManager::CleanupWorkspace(Workspace* workspace) { |
| 371 if (workspace->type() != Workspace::TYPE_MANAGED && workspace->is_empty()) | 363 if (workspace->type() != Workspace::TYPE_MANAGED && workspace->is_empty()) |
| 372 delete workspace; | 364 delete workspace; |
| 373 } | 365 } |
| 374 | 366 |
| 375 } // namespace internal | 367 } // namespace internal |
| 376 } // namespace ash | 368 } // namespace ash |
| OLD | NEW |