| 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> |
| 11 | 11 |
| 12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
| 13 #include "ash/shell_observer.h" | 13 #include "ash/shell_observer.h" |
| 14 #include "ash/wm/workspace/base_workspace_manager.h" | 14 #include "ash/wm/workspace/workspace_types.h" |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/time.h" | 18 #include "base/time.h" |
| 19 #include "base/timer.h" | 19 #include "base/timer.h" |
| 20 #include "ui/base/ui_base_types.h" | 20 #include "ui/base/ui_base_types.h" |
| 21 | 21 |
| 22 namespace aura { | 22 namespace aura { |
| 23 class Window; | 23 class Window; |
| 24 } | 24 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 44 class WorkspaceLayoutManager2; | 44 class WorkspaceLayoutManager2; |
| 45 class WorkspaceManagerTest2; | 45 class WorkspaceManagerTest2; |
| 46 class Workspace2; | 46 class Workspace2; |
| 47 | 47 |
| 48 // WorkspaceManager manages multiple workspaces in the desktop. Workspaces are | 48 // WorkspaceManager manages multiple workspaces in the desktop. Workspaces are |
| 49 // implicitly created as windows are maximized (or made fullscreen), and | 49 // implicitly created as windows are maximized (or made fullscreen), and |
| 50 // destroyed when maximized windows are closed or restored. There is always one | 50 // destroyed when maximized windows are closed or restored. There is always one |
| 51 // workspace for the desktop. | 51 // workspace for the desktop. |
| 52 // Internally WorkspaceManager2 creates a Window for each Workspace. As windows | 52 // Internally WorkspaceManager2 creates a Window for each Workspace. As windows |
| 53 // are maximized and restored they are reparented to the right Window. | 53 // are maximized and restored they are reparented to the right Window. |
| 54 class ASH_EXPORT WorkspaceManager2 | 54 class ASH_EXPORT WorkspaceManager2 : public ash::ShellObserver { |
| 55 : public BaseWorkspaceManager, | |
| 56 public ash::ShellObserver { | |
| 57 public: | 55 public: |
| 58 explicit WorkspaceManager2(aura::Window* viewport); | 56 explicit WorkspaceManager2(aura::Window* viewport); |
| 59 virtual ~WorkspaceManager2(); | 57 virtual ~WorkspaceManager2(); |
| 60 | 58 |
| 61 // Returns true if |window| is considered maximized and should exist in its | 59 // Returns true if |window| is considered maximized and should exist in its |
| 62 // own workspace. | 60 // own workspace. |
| 63 static bool IsMaximized(aura::Window* window); | 61 static bool IsMaximized(aura::Window* window); |
| 64 static bool IsMaximizedState(ui::WindowShowState state); | 62 static bool IsMaximizedState(ui::WindowShowState state); |
| 65 | 63 |
| 66 // Returns true if |window| is minimized and will restore to a maximized | 64 // Returns true if |window| is minimized and will restore to a maximized |
| 67 // window. | 65 // window. |
| 68 static bool WillRestoreMaximized(aura::Window* window); | 66 static bool WillRestoreMaximized(aura::Window* window); |
| 69 | 67 |
| 70 // BaseWorkspaceManager overrides: | 68 // Returns the current window state. |
| 71 virtual bool IsInMaximizedMode() const OVERRIDE; | 69 WorkspaceWindowState GetWindowState() const; |
| 72 virtual WorkspaceWindowState GetWindowState() const OVERRIDE; | 70 |
| 73 virtual void SetShelf(ShelfLayoutManager* shelf) OVERRIDE; | 71 void SetShelf(ShelfLayoutManager* shelf); |
| 74 virtual void SetActiveWorkspaceByWindow(aura::Window* window) OVERRIDE; | 72 |
| 75 virtual aura::Window* GetParentForNewWindow(aura::Window* window) OVERRIDE; | 73 // Activates the workspace containing |window|. Does nothing if |window| is |
| 76 virtual void DoInitialAnimation() OVERRIDE; | 74 // NULL or not contained in a workspace. |
| 75 void SetActiveWorkspaceByWindow(aura::Window* window); |
| 76 |
| 77 // Returns the parent for |window|. This is invoked from StackingController |
| 78 // when a new Window is being added. |
| 79 aura::Window* GetParentForNewWindow(aura::Window* window); |
| 80 |
| 81 // Starts the animation that occurs on first login. |
| 82 void DoInitialAnimation(); |
| 77 | 83 |
| 78 // ShellObserver overrides: | 84 // ShellObserver overrides: |
| 79 virtual void OnAppTerminating() OVERRIDE; | 85 virtual void OnAppTerminating() OVERRIDE; |
| 80 | 86 |
| 81 private: | 87 private: |
| 82 friend class WorkspaceLayoutManager2; | 88 friend class WorkspaceLayoutManager2; |
| 83 friend class WorkspaceManager2Test; | 89 friend class WorkspaceManager2Test; |
| 84 | 90 |
| 85 class LayoutManagerImpl; | 91 class LayoutManagerImpl; |
| 86 | 92 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 // DesktopBackgroundFadeController. | 250 // DesktopBackgroundFadeController. |
| 245 bool creating_fade_; | 251 bool creating_fade_; |
| 246 | 252 |
| 247 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2); | 253 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager2); |
| 248 }; | 254 }; |
| 249 | 255 |
| 250 } // namespace internal | 256 } // namespace internal |
| 251 } // namespace ash | 257 } // namespace ash |
| 252 | 258 |
| 253 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ | 259 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER2_H_ |
| OLD | NEW |