Chromium Code Reviews| Index: ash/wm/workspace/workspace_manager.h |
| diff --git a/ash/wm/workspace/workspace_manager.h b/ash/wm/workspace/workspace_manager.h |
| index e59eada1c6ea9d7d1c4898926fc050fcfde8b101..a0df84ccd54615e537139b1bce5b9d79466d0b24 100644 |
| --- a/ash/wm/workspace/workspace_manager.h |
| +++ b/ash/wm/workspace/workspace_manager.h |
| @@ -78,9 +78,24 @@ class ASH_EXPORT WorkspaceManager : public ash::ShellObserver { |
| // when a new Window is being added. |
| aura::Window* GetParentForNewWindow(aura::Window* window); |
| + // Called by the workspace cycler to hide the currently active workspace. |
| + // The currently active workspace is moved to |hidden_workspaces_|. |
| + // Returns false if there are no workspaces which can be hidden. This will be |
| + // the case if the desktop workspace is currently active. |
| + bool CycleAwayFromCurrentlyActiveWorkspace(); |
|
sadrul
2012/11/23 20:02:07
Where does it cycle to?
|
| + |
| + // Called by the workspace cycler to activate the workspace in |
| + // |hidden_workspaces_| which was most recently added. Activating the |
| + // workspace moves it to |workspaces_|. |
| + // Returns false if |hidden_workspaces| is empty. |
| + bool CycleToNextHiddenWorkspace(); |
| + |
| // Starts the animation that occurs on first login. |
| void DoInitialAnimation(); |
| + // Returns the window of the currently active workspace. |
| + aura::Window* GetActiveWorkspaceWindow() const; |
| + |
| // ShellObserver overrides: |
| virtual void OnAppTerminating() OVERRIDE; |
| @@ -137,11 +152,11 @@ class ASH_EXPORT WorkspaceManager : public ash::ShellObserver { |
| // Moves all the non-maximized child windows of |workspace| to the desktop |
| // stacked beneath |stack_beneath| (if non-NULL). After moving child windows |
| - // if |workspace| contains no children it is deleted, otherwise it it moved to |
| - // |pending_workspaces_|. |
| - void MoveWorkspaceToPendingOrDelete(Workspace* workspace, |
| - aura::Window* stack_beneath, |
| - SwitchReason reason); |
| + // if |workspace| contains no children it is deleted. Otherwise, it is moved |
| + // to |hidden_workspaces_|. |
| + void MoveWorkspaceToHiddenOrDelete(Workspace* workspace, |
| + aura::Window* stack_beneath, |
| + SwitchReason reason); |
| // Moves the children of |window| to the desktop. This excludes certain |
| // windows. If |stack_beneath| is non-NULL the windows are stacked beneath it. |
| @@ -207,11 +222,14 @@ class ASH_EXPORT WorkspaceManager : public ash::ShellObserver { |
| // which identifies the desktop. |
| Workspaces workspaces_; |
| - // The set of workspaces not currently active. Workspaces ended up here in |
| - // two scenarios: |
| - // . Prior to adding a window a new worskpace is created for it. The |
| - // Workspace is added to this set. |
| - // . When the maximized window is minimized the workspace is added here. |
| + // List of inactive workspaces which were deactivated as a result of a user |
| + // action. Workspaces are moved here from |workspaces_| when the workspace's |
| + // maximized window is minimized or hidden. The workspace is moved back to |
| + // |workspaces_| when one of its windows is activated. |
| + Workspaces hidden_workspaces_; |
| + |
| + // Set of workspaces that have never been activated. Workspaces for new |
| + // windows prior to those windows being activated are added to this set. |
| // Once any window in the workspace is activated the workspace is moved to |
| // |workspaces_|. |
| std::set<Workspace*> pending_workspaces_; |
| @@ -219,10 +237,10 @@ class ASH_EXPORT WorkspaceManager : public ash::ShellObserver { |
| // Owned by the Shell. May be NULL. |
| ShelfLayoutManager* shelf_; |
| - // Whether or not we're in MoveWorkspaceToPendingOrDelete(). As |
| - // MoveWorkspaceToPendingOrDelete() may trigger another call to |
| - // MoveWorkspaceToPendingOrDelete() we use this to avoid doing anything if |
| - // already in MoveWorkspaceToPendingOrDelete(). |
| + // Whether or not we're in MoveWorkspaceToHiddenOrDelete(). As |
| + // MoveWorkspaceToHiddenOrDelete() may trigger another call to |
| + // MoveWorkspaceToHiddenOrDelete() we use this to avoid doing anything if |
| + // already in MoveWorkspaceToHiddenOrDelete(). |
| bool in_move_; |
| // Ideally we would delete workspaces when not needed. Unfortunately doing so |