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_COMMON_WM_WORKSPACE_CONTROLLER_H_ |
6 #define ASH_WM_WORKSPACE_CONTROLLER_H_ | 6 #define ASH_COMMON_WM_WORKSPACE_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "ash/common/wm/workspace/workspace_types.h" | 11 #include "ash/common/wm/workspace/workspace_types.h" |
12 #include "ash/common/wm_window_observer.h" | |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 | 14 |
14 namespace ash { | 15 namespace ash { |
15 class WmWindow; | 16 class WmWindow; |
16 class WorkspaceControllerTestHelper; | 17 class WorkspaceControllerTestHelper; |
17 class WorkspaceEventHandler; | 18 class WorkspaceEventHandler; |
18 class WorkspaceLayoutManager; | 19 class WorkspaceLayoutManager; |
19 class WorkspaceLayoutManagerBackdropDelegate; | 20 class WorkspaceLayoutManagerBackdropDelegate; |
20 | 21 |
21 // WorkspaceController acts as a central place that ties together all the | 22 // WorkspaceController acts as a central place that ties together all the |
22 // various workspace pieces. | 23 // various workspace pieces. |
23 class ASH_EXPORT WorkspaceController { | 24 class ASH_EXPORT WorkspaceController : public WmWindowObserver { |
msw
2016/08/30 17:46:20
nit: it'd be nice if you could cleanup WmRootWindo
sky
2016/08/30 17:55:09
Yes, I was planning on doing that once I merge Roo
| |
24 public: | 25 public: |
25 explicit WorkspaceController(WmWindow* viewport); | 26 explicit WorkspaceController(WmWindow* viewport); |
26 virtual ~WorkspaceController(); | 27 ~WorkspaceController() override; |
27 | 28 |
28 // Returns the current window state. | 29 // Returns the current window state. |
29 wm::WorkspaceWindowState GetWindowState() const; | 30 wm::WorkspaceWindowState GetWindowState() const; |
30 | 31 |
31 // Starts the animation that occurs on first login. | 32 // Starts the animation that occurs on first login. |
32 void DoInitialAnimation(); | 33 void DoInitialAnimation(); |
33 | 34 |
34 // Add a delegate which adds a backdrop behind the top window of the default | 35 // Add a delegate which adds a backdrop behind the top window of the default |
35 // workspace. | 36 // workspace. |
36 void SetMaximizeBackdropDelegate( | 37 void SetMaximizeBackdropDelegate( |
37 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate); | 38 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate); |
38 | 39 |
39 WorkspaceLayoutManager* layout_manager() { return layout_manager_; } | 40 WorkspaceLayoutManager* layout_manager() { return layout_manager_; } |
40 | 41 |
41 private: | 42 private: |
42 friend class WorkspaceControllerTestHelper; | 43 friend class WorkspaceControllerTestHelper; |
43 | 44 |
45 // WmWindowObserver: | |
46 void OnWindowDestroying(WmWindow* window) override; | |
47 | |
44 WmWindow* viewport_; | 48 WmWindow* viewport_; |
45 std::unique_ptr<WorkspaceEventHandler> event_handler_; | 49 std::unique_ptr<WorkspaceEventHandler> event_handler_; |
46 | 50 |
47 // Owned by |viewport_|. | 51 // Owned by |viewport_|. |
48 WorkspaceLayoutManager* layout_manager_; | 52 WorkspaceLayoutManager* layout_manager_; |
49 | 53 |
50 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); | 54 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); |
51 }; | 55 }; |
52 | 56 |
53 } // namespace ash | 57 } // namespace ash |
54 | 58 |
55 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ | 59 #endif // ASH_COMMON_WM_WORKSPACE_CONTROLLER_H_ |
OLD | NEW |