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 BaseWorkspaceManager; | |
22 class ShelfLayoutManager; | 21 class ShelfLayoutManager; |
23 class WorkspaceControllerTestHelper; | 22 class WorkspaceControllerTestHelper; |
24 class WorkspaceEventHandler; | 23 class WorkspaceEventHandler; |
25 class WorkspaceLayoutManager; | 24 class WorkspaceManager2; |
26 | 25 |
27 // WorkspaceController acts as a central place that ties together all the | 26 // WorkspaceController acts as a central place that ties together all the |
28 // various workspace pieces. | 27 // various workspace pieces. |
29 class ASH_EXPORT WorkspaceController | 28 class ASH_EXPORT WorkspaceController |
30 : public aura::client::ActivationChangeObserver { | 29 : public aura::client::ActivationChangeObserver { |
31 public: | 30 public: |
32 explicit WorkspaceController(aura::Window* viewport); | 31 explicit WorkspaceController(aura::Window* viewport); |
33 virtual ~WorkspaceController(); | 32 virtual ~WorkspaceController(); |
34 | 33 |
35 // Returns true if Workspace2 is enabled. | |
36 static bool IsWorkspace2Enabled(); | |
37 | |
38 // Returns true if in maximized or fullscreen mode. | |
39 bool IsInMaximizedMode() const; | |
40 | |
41 // Returns the current window state. | 34 // Returns the current window state. |
42 WorkspaceWindowState GetWindowState() const; | 35 WorkspaceWindowState GetWindowState() const; |
43 | 36 |
44 void SetShelf(ShelfLayoutManager* shelf); | 37 void SetShelf(ShelfLayoutManager* shelf); |
45 | 38 |
46 // Sets the active workspace based on |window|. | 39 // Sets the active workspace based on |window|. |
47 void SetActiveWorkspaceByWindow(aura::Window* window); | 40 void SetActiveWorkspaceByWindow(aura::Window* window); |
48 | 41 |
49 // See description in BaseWorkspaceManager::GetParentForNewWindow(). | 42 // See description in BaseWorkspaceManager::GetParentForNewWindow(). |
50 aura::Window* GetParentForNewWindow(aura::Window* window); | 43 aura::Window* GetParentForNewWindow(aura::Window* window); |
51 | 44 |
52 // Starts the animation that occurs on first login. | 45 // Starts the animation that occurs on first login. |
53 void DoInitialAnimation(); | 46 void DoInitialAnimation(); |
54 | 47 |
55 // aura::client::ActivationChangeObserver overrides: | 48 // aura::client::ActivationChangeObserver overrides: |
56 virtual void OnWindowActivated(aura::Window* window, | 49 virtual void OnWindowActivated(aura::Window* window, |
57 aura::Window* old_active) OVERRIDE; | 50 aura::Window* old_active) OVERRIDE; |
58 | 51 |
59 private: | 52 private: |
60 friend class WorkspaceControllerTestHelper; | 53 friend class WorkspaceControllerTestHelper; |
61 | 54 |
62 aura::Window* viewport_; | 55 aura::Window* viewport_; |
63 | 56 |
64 scoped_ptr<BaseWorkspaceManager> workspace_manager_; | 57 scoped_ptr<WorkspaceManager2> workspace_manager_; |
65 | |
66 // TODO(sky): remove |layout_manager_| and |event_handler_| when Workspace2 | |
67 // is the default. | |
68 | |
69 // Owned by the window its attached to. | |
70 WorkspaceLayoutManager* layout_manager_; | |
71 | |
72 // Owned by |viewport_|. | |
73 WorkspaceEventHandler* event_handler_; | |
74 | 58 |
75 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); | 59 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); |
76 }; | 60 }; |
77 | 61 |
78 } // namespace internal | 62 } // namespace internal |
79 } // namespace ash | 63 } // namespace ash |
80 | 64 |
81 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ | 65 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ |
OLD | NEW |