Chromium Code Reviews| 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_CONTROLLER_H_ | 5 #ifndef ASH_WM_WORKSPACE_CONTROLLER_H_ |
| 6 #define ASH_WM_WORKSPACE_CONTROLLER_H_ | 6 #define ASH_WM_WORKSPACE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/wm/workspace/workspace_types.h" | 9 #include "ash/wm/workspace/workspace_types.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "ui/aura/client/activation_change_observer.h" | 12 #include "ui/aura/client/activation_change_observer.h" |
| 13 | 13 |
| 14 namespace aura { | 14 namespace aura { |
| 15 class Window; | 15 class Window; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace internal { | 19 namespace internal { |
| 20 | 20 |
| 21 class ShelfLayoutManager; | 21 class ShelfLayoutManager; |
| 22 class WorkspaceControllerTestHelper; | 22 class WorkspaceControllerTestHelper; |
| 23 class WorkspaceCycler; | 23 class WorkspaceCycler; |
| 24 class WorkspaceEventHandler; | 24 class WorkspaceEventHandler; |
| 25 class WorkspaceManager; | 25 class WorkspaceManager; |
| 26 class Workspace; | |
| 26 | 27 |
| 27 // WorkspaceController acts as a central place that ties together all the | 28 // WorkspaceController acts as a central place that ties together all the |
| 28 // various workspace pieces. | 29 // various workspace pieces. |
| 29 class ASH_EXPORT WorkspaceController | 30 class ASH_EXPORT WorkspaceController |
| 30 : public aura::client::ActivationChangeObserver { | 31 : public aura::client::ActivationChangeObserver { |
| 31 public: | 32 public: |
| 32 explicit WorkspaceController(aura::Window* viewport); | 33 explicit WorkspaceController(aura::Window* viewport); |
| 33 virtual ~WorkspaceController(); | 34 virtual ~WorkspaceController(); |
| 34 | 35 |
| 35 // Returns the current window state. | 36 // Returns the current window state. |
| 36 WorkspaceWindowState GetWindowState() const; | 37 WorkspaceWindowState GetWindowState() const; |
| 37 | 38 |
| 38 void SetShelf(ShelfLayoutManager* shelf); | 39 void SetShelf(ShelfLayoutManager* shelf); |
| 39 | 40 |
| 40 // Sets the active workspace based on |window|. | 41 // Sets the active workspace based on |window|. |
| 41 void SetActiveWorkspaceByWindow(aura::Window* window); | 42 void SetActiveWorkspaceByWindow(aura::Window* window); |
| 42 | 43 |
| 44 // Returns the currently active workspace. | |
|
sky
2013/01/10 19:02:05
Same comment about not exposing workspace. I'm ok
| |
| 45 Workspace* GetActiveWorkspace() const; | |
| 46 | |
| 43 // See description in BaseWorkspaceManager::GetParentForNewWindow(). | 47 // See description in BaseWorkspaceManager::GetParentForNewWindow(). |
| 44 aura::Window* GetParentForNewWindow(aura::Window* window); | 48 aura::Window* GetParentForNewWindow(aura::Window* window); |
| 45 | 49 |
| 46 // Starts the animation that occurs on first login. | 50 // Starts the animation that occurs on first login. |
| 47 void DoInitialAnimation(); | 51 void DoInitialAnimation(); |
| 48 | 52 |
| 49 // aura::client::ActivationChangeObserver overrides: | 53 // aura::client::ActivationChangeObserver overrides: |
| 50 virtual void OnWindowActivated(aura::Window* gained_active, | 54 virtual void OnWindowActivated(aura::Window* gained_active, |
| 51 aura::Window* lost_active) OVERRIDE; | 55 aura::Window* lost_active) OVERRIDE; |
| 52 | 56 |
| 53 private: | 57 private: |
| 54 friend class WorkspaceControllerTestHelper; | 58 friend class WorkspaceControllerTestHelper; |
| 55 | 59 |
| 56 aura::Window* viewport_; | 60 aura::Window* viewport_; |
| 57 | 61 |
| 58 scoped_ptr<WorkspaceManager> workspace_manager_; | 62 scoped_ptr<WorkspaceManager> workspace_manager_; |
| 59 | 63 |
| 60 // Cycles through the WorkspaceManager's workspaces in response to a three | 64 // Cycles through the WorkspaceManager's workspaces in response to a three |
| 61 // finger vertical scroll. | 65 // finger vertical scroll. |
| 62 scoped_ptr<WorkspaceCycler> workspace_cycler_; | 66 scoped_ptr<WorkspaceCycler> workspace_cycler_; |
| 63 | 67 |
| 64 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); | 68 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace internal | 71 } // namespace internal |
| 68 } // namespace ash | 72 } // namespace ash |
| 69 | 73 |
| 70 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ | 74 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ |
| OLD | NEW |