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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // own workspace. | 54 // own workspace. |
55 static bool IsMaximized(aura::Window* window); | 55 static bool IsMaximized(aura::Window* window); |
56 static bool IsMaximizedState(ui::WindowShowState state); | 56 static bool IsMaximizedState(ui::WindowShowState state); |
57 | 57 |
58 // Returns true if |window| is minimized and will restore to a maximized | 58 // Returns true if |window| is minimized and will restore to a maximized |
59 // window. | 59 // window. |
60 static bool WillRestoreMaximized(aura::Window* window); | 60 static bool WillRestoreMaximized(aura::Window* window); |
61 | 61 |
62 // BaseWorkspaceManager2 overrides: | 62 // BaseWorkspaceManager2 overrides: |
63 virtual bool IsInMaximizedMode() const OVERRIDE; | 63 virtual bool IsInMaximizedMode() const OVERRIDE; |
64 virtual void SetGridSize(int size) OVERRIDE; | |
65 virtual int GetGridSize() const OVERRIDE; | |
66 virtual WorkspaceWindowState GetWindowState() const OVERRIDE; | 64 virtual WorkspaceWindowState GetWindowState() const OVERRIDE; |
67 virtual void SetShelf(ShelfLayoutManager* shelf) OVERRIDE; | 65 virtual void SetShelf(ShelfLayoutManager* shelf) OVERRIDE; |
68 virtual void SetActiveWorkspaceByWindow(aura::Window* window) OVERRIDE; | 66 virtual void SetActiveWorkspaceByWindow(aura::Window* window) OVERRIDE; |
69 virtual aura::Window* GetParentForNewWindow(aura::Window* window) OVERRIDE; | 67 virtual aura::Window* GetParentForNewWindow(aura::Window* window) OVERRIDE; |
70 | 68 |
71 private: | 69 private: |
72 friend class WorkspaceLayoutManager2; | 70 friend class WorkspaceLayoutManager2; |
73 friend class WorkspaceManager2Test; | 71 friend class WorkspaceManager2Test; |
74 | 72 |
75 class LayoutManager; | 73 class LayoutManager; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 158 |
161 // The set of workspaces not currently active. Workspaces ended up here in | 159 // The set of workspaces not currently active. Workspaces ended up here in |
162 // two scenarios: | 160 // two scenarios: |
163 // . Prior to adding a window a new worskpace is created for it. The | 161 // . Prior to adding a window a new worskpace is created for it. The |
164 // Workspace is added to this set. | 162 // Workspace is added to this set. |
165 // . When the maximized window is minimized the workspace is added here. | 163 // . When the maximized window is minimized the workspace is added here. |
166 // Once any window in the workspace is activated the workspace is moved to | 164 // Once any window in the workspace is activated the workspace is moved to |
167 // |workspaces_|. | 165 // |workspaces_|. |
168 std::set<Workspace2*> pending_workspaces_; | 166 std::set<Workspace2*> pending_workspaces_; |
169 | 167 |
170 // See description above setter. | |
171 int grid_size_; | |
172 | |
173 // Owned by the Shell. May be NULL. | 168 // Owned by the Shell. May be NULL. |
174 ShelfLayoutManager* shelf_; | 169 ShelfLayoutManager* shelf_; |
175 | 170 |
176 // Whether or not we're in MoveWorkspaceToPendingOrDelete(). As | 171 // Whether or not we're in MoveWorkspaceToPendingOrDelete(). As |
177 // MoveWorkspaceToPendingOrDelete() may trigger another call to | 172 // MoveWorkspaceToPendingOrDelete() may trigger another call to |
178 // MoveWorkspaceToPendingOrDelete() we use this to avoid doing anything if | 173 // MoveWorkspaceToPendingOrDelete() we use this to avoid doing anything if |
179 // already in MoveWorkspaceToPendingOrDelete(). | 174 // already in MoveWorkspaceToPendingOrDelete(). |
180 bool in_move_; | 175 bool in_move_; |
181 | 176 |
182 // Ideally we would delete workspaces when not needed. Unfortunately doing so | 177 // Ideally we would delete workspaces when not needed. Unfortunately doing so |
(...skipping 17 matching lines...) Expand all Loading... |
200 // See comments in SetUnminimizingWorkspace() for details. | 195 // See comments in SetUnminimizingWorkspace() for details. |
201 Workspace2* unminimizing_workspace_; | 196 Workspace2* unminimizing_workspace_; |
202 | 197 |
203 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2); | 198 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2); |
204 }; | 199 }; |
205 | 200 |
206 } // namespace internal | 201 } // namespace internal |
207 } // namespace ash | 202 } // namespace ash |
208 | 203 |
209 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ | 204 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ |
OLD | NEW |