| 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 #ifndef ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ | 6 #define ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace ui { | 28 namespace ui { |
| 29 class Layer; | 29 class Layer; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace ash { | 32 namespace ash { |
| 33 namespace internal { | 33 namespace internal { |
| 34 | 34 |
| 35 class ShelfLayoutManager; | 35 class ShelfLayoutManager; |
| 36 class SystemBackgroundController; |
| 36 class WorkspaceLayoutManager2; | 37 class WorkspaceLayoutManager2; |
| 37 class WorkspaceManagerTest2; | 38 class WorkspaceManagerTest2; |
| 38 class Workspace2; | 39 class Workspace2; |
| 39 | 40 |
| 40 // WorkspaceManager manages multiple workspaces in the desktop. Workspaces are | 41 // WorkspaceManager manages multiple workspaces in the desktop. Workspaces are |
| 41 // implicitly created as windows are maximized (or made fullscreen), and | 42 // implicitly created as windows are maximized (or made fullscreen), and |
| 42 // destroyed when maximized windows are closed or restored. There is always one | 43 // destroyed when maximized windows are closed or restored. There is always one |
| 43 // workspace for the desktop. | 44 // workspace for the desktop. |
| 44 // Internally WorkspaceManager2 creates a Window for each Workspace. As windows | 45 // Internally WorkspaceManager2 creates a Window for each Workspace. As windows |
| 45 // are maximized and restored they are reparented to the right Window. | 46 // are maximized and restored they are reparented to the right Window. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 void SelectNextWorkspace(AnimateType animate_type); | 121 void SelectNextWorkspace(AnimateType animate_type); |
| 121 | 122 |
| 122 // Schedules |workspace| for deletion when it no longer contains any layers. | 123 // Schedules |workspace| for deletion when it no longer contains any layers. |
| 123 // See comments above |to_delete_| as to why we do this. | 124 // See comments above |to_delete_| as to why we do this. |
| 124 void ScheduleDelete(Workspace2* workspace); | 125 void ScheduleDelete(Workspace2* workspace); |
| 125 | 126 |
| 126 // Deletes any workspaces scheduled via ScheduleDelete() that don't contain | 127 // Deletes any workspaces scheduled via ScheduleDelete() that don't contain |
| 127 // any layers. | 128 // any layers. |
| 128 void ProcessDeletion(); | 129 void ProcessDeletion(); |
| 129 | 130 |
| 131 // Deletes |background_controller_|. Called from |destroy_background_timer_|. |
| 132 void DestroySystemBackground(); |
| 133 |
| 130 // These methods are forwarded from the LayoutManager installed on the | 134 // These methods are forwarded from the LayoutManager installed on the |
| 131 // Workspace's window. | 135 // Workspace's window. |
| 132 void OnWindowAddedToWorkspace(Workspace2* workspace, aura::Window* child); | 136 void OnWindowAddedToWorkspace(Workspace2* workspace, aura::Window* child); |
| 133 void OnWillRemoveWindowFromWorkspace(Workspace2* workspace, | 137 void OnWillRemoveWindowFromWorkspace(Workspace2* workspace, |
| 134 aura::Window* child); | 138 aura::Window* child); |
| 135 void OnWindowRemovedFromWorkspace(Workspace2* workspace, aura::Window* child); | 139 void OnWindowRemovedFromWorkspace(Workspace2* workspace, aura::Window* child); |
| 136 void OnWorkspaceChildWindowVisibilityChanged(Workspace2* workspace, | 140 void OnWorkspaceChildWindowVisibilityChanged(Workspace2* workspace, |
| 137 aura::Window* child); | 141 aura::Window* child); |
| 138 void OnWorkspaceWindowChildBoundsChanged(Workspace2* workspace, | 142 void OnWorkspaceWindowChildBoundsChanged(Workspace2* workspace, |
| 139 aura::Window* child); | 143 aura::Window* child); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // already in MoveWorkspaceToPendingOrDelete(). | 175 // already in MoveWorkspaceToPendingOrDelete(). |
| 172 bool in_move_; | 176 bool in_move_; |
| 173 | 177 |
| 174 // Ideally we would delete workspaces when not needed. Unfortunately doing so | 178 // Ideally we would delete workspaces when not needed. Unfortunately doing so |
| 175 // would effectively cancel animations. Instead when a workspace is no longer | 179 // would effectively cancel animations. Instead when a workspace is no longer |
| 176 // needed we add it here and start a timer. When the timer fires any windows | 180 // needed we add it here and start a timer. When the timer fires any windows |
| 177 // no longer contain layers are deleted. | 181 // no longer contain layers are deleted. |
| 178 std::set<Workspace2*> to_delete_; | 182 std::set<Workspace2*> to_delete_; |
| 179 base::OneShotTimer<WorkspaceManager2> delete_timer_; | 183 base::OneShotTimer<WorkspaceManager2> delete_timer_; |
| 180 | 184 |
| 185 // Used to show the system level background. Non-null when the background is |
| 186 // visible. |
| 187 scoped_ptr<SystemBackgroundController> background_controller_; |
| 188 |
| 189 // Timer used to destroy the background. We wait to destroy until animations |
| 190 // complete. |
| 191 base::OneShotTimer<WorkspaceManager2> destroy_background_timer_; |
| 192 |
| 181 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2); | 193 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2); |
| 182 }; | 194 }; |
| 183 | 195 |
| 184 } // namespace internal | 196 } // namespace internal |
| 185 } // namespace ash | 197 } // namespace ash |
| 186 | 198 |
| 187 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ | 199 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ |
| OLD | NEW |