| 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 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 base::TimeDelta()); | 229 base::TimeDelta()); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 if (workspace->is_maximized() && IsMaximized(window)) { | 232 if (workspace->is_maximized() && IsMaximized(window)) { |
| 233 // Clicking on the maximized window in a maximized workspace. Force all | 233 // Clicking on the maximized window in a maximized workspace. Force all |
| 234 // other windows to drop to the desktop. | 234 // other windows to drop to the desktop. |
| 235 MoveChildrenToDesktop(workspace->window(), NULL); | 235 MoveChildrenToDesktop(workspace->window(), NULL); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 Window* WorkspaceManager::GetActiveWorkspaceWindow() { |
| 240 return active_workspace_->window(); |
| 241 } |
| 242 |
| 239 Window* WorkspaceManager::GetParentForNewWindow(Window* window) { | 243 Window* WorkspaceManager::GetParentForNewWindow(Window* window) { |
| 240 // Try to put windows with transient parents in the same workspace as their | 244 // Try to put windows with transient parents in the same workspace as their |
| 241 // transient parent. | 245 // transient parent. |
| 242 if (window->transient_parent() && !IsMaximized(window)) { | 246 if (window->transient_parent() && !IsMaximized(window)) { |
| 243 Workspace* workspace = FindBy(window->transient_parent()); | 247 Workspace* workspace = FindBy(window->transient_parent()); |
| 244 if (workspace) | 248 if (workspace) |
| 245 return workspace->window(); | 249 return workspace->window(); |
| 246 // Fall through to normal logic. | 250 // Fall through to normal logic. |
| 247 } | 251 } |
| 248 | 252 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 new_workspace->window()->Show(); | 764 new_workspace->window()->Show(); |
| 761 ReparentWindow(window, new_workspace->window(), NULL); | 765 ReparentWindow(window, new_workspace->window(), NULL); |
| 762 if (is_active) { | 766 if (is_active) { |
| 763 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED, | 767 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED, |
| 764 base::TimeDelta()); | 768 base::TimeDelta()); |
| 765 } | 769 } |
| 766 } | 770 } |
| 767 | 771 |
| 768 } // namespace internal | 772 } // namespace internal |
| 769 } // namespace ash | 773 } // namespace ash |
| OLD | NEW |