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 "base/basictypes.h" | 10 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
11 #include "ui/aura/client/activation_change_observer.h" | 12 #include "ui/aura/client/activation_change_observer.h" |
12 | 13 |
13 namespace aura { | 14 namespace aura { |
14 class Window; | 15 class Window; |
15 } | 16 } |
16 | 17 |
17 namespace ash { | 18 namespace ash { |
18 namespace internal { | 19 namespace internal { |
19 | 20 |
| 21 class ShelfLayoutManager; |
20 class WorkspaceControllerTestHelper; | 22 class WorkspaceControllerTestHelper; |
21 class WorkspaceEventFilter; | 23 class WorkspaceEventFilter; |
22 class WorkspaceLayoutManager; | 24 class WorkspaceLayoutManager; |
23 class WorkspaceManager; | 25 class WorkspaceManager; |
24 | 26 |
25 // WorkspaceController acts as a central place that ties together all the | 27 // WorkspaceController acts as a central place that ties together all the |
26 // various workspace pieces: WorkspaceManager, WorkspaceLayoutManager and | 28 // various workspace pieces: WorkspaceManager, WorkspaceLayoutManager and |
27 // WorkspaceEventFilter. | 29 // WorkspaceEventFilter. |
28 class ASH_EXPORT WorkspaceController : | 30 class ASH_EXPORT WorkspaceController |
29 public aura::client::ActivationChangeObserver { | 31 : public aura::client::ActivationChangeObserver { |
30 public: | 32 public: |
31 explicit WorkspaceController(aura::Window* viewport); | 33 explicit WorkspaceController(aura::Window* viewport); |
32 virtual ~WorkspaceController(); | 34 virtual ~WorkspaceController(); |
33 | 35 |
34 // Returns the workspace manager that this controller owns. | 36 // Returns true if in maximized or fullscreen mode. |
35 WorkspaceManager* workspace_manager() { | 37 bool IsInMaximizedMode() const; |
36 return workspace_manager_.get(); | |
37 } | |
38 | 38 |
39 // Sets the size of the grid. | 39 // Sets the size of the grid. |
40 void SetGridSize(int grid_size); | 40 void SetGridSize(int grid_size); |
| 41 int GetGridSize() const; |
| 42 |
| 43 // Returns the current window state. |
| 44 WorkspaceWindowState GetWindowState() const; |
| 45 |
| 46 void SetShelf(ShelfLayoutManager* shelf); |
41 | 47 |
42 // aura::client::ActivationChangeObserver overrides: | 48 // aura::client::ActivationChangeObserver overrides: |
43 virtual void OnWindowActivated(aura::Window* window, | 49 virtual void OnWindowActivated(aura::Window* window, |
44 aura::Window* old_active) OVERRIDE; | 50 aura::Window* old_active) OVERRIDE; |
45 | 51 |
46 private: | 52 private: |
47 friend class WorkspaceControllerTestHelper; | 53 friend class WorkspaceControllerTestHelper; |
48 | 54 |
49 aura::Window* viewport_; | 55 aura::Window* viewport_; |
50 | 56 |
51 scoped_ptr<WorkspaceManager> workspace_manager_; | 57 scoped_ptr<WorkspaceManager> workspace_manager_; |
52 | 58 |
53 // Owned by the window its attached to. | 59 // Owned by the window its attached to. |
54 WorkspaceLayoutManager* layout_manager_; | 60 WorkspaceLayoutManager* layout_manager_; |
55 | 61 |
56 // Owned by |viewport_|. | 62 // Owned by |viewport_|. |
57 WorkspaceEventFilter* event_filter_; | 63 WorkspaceEventFilter* event_filter_; |
58 | 64 |
59 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); | 65 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); |
60 }; | 66 }; |
61 | 67 |
62 } // namespace internal | 68 } // namespace internal |
63 } // namespace ash | 69 } // namespace ash |
64 | 70 |
65 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ | 71 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ |
OLD | NEW |