| 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_COMMON_WM_WORKSPACE_CONTROLLER_H_ | 5 #ifndef ASH_COMMON_WM_WORKSPACE_CONTROLLER_H_ |
| 6 #define ASH_COMMON_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" | |
| 13 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/aura/window_observer.h" |
| 14 | 14 |
| 15 namespace ash { | 15 namespace ash { |
| 16 class WmWindow; | 16 class WmWindow; |
| 17 class WorkspaceControllerTestHelper; | 17 class WorkspaceControllerTestHelper; |
| 18 class WorkspaceEventHandler; | 18 class WorkspaceEventHandler; |
| 19 class WorkspaceLayoutManager; | 19 class WorkspaceLayoutManager; |
| 20 class WorkspaceLayoutManagerBackdropDelegate; | 20 class WorkspaceLayoutManagerBackdropDelegate; |
| 21 | 21 |
| 22 // WorkspaceController acts as a central place that ties together all the | 22 // WorkspaceController acts as a central place that ties together all the |
| 23 // various workspace pieces. | 23 // various workspace pieces. |
| 24 class ASH_EXPORT WorkspaceController : public WmWindowObserver { | 24 class ASH_EXPORT WorkspaceController : public aura::WindowObserver { |
| 25 public: | 25 public: |
| 26 // Installs WorkspaceLayoutManager on |viewport|. | 26 // Installs WorkspaceLayoutManager on |viewport|. |
| 27 explicit WorkspaceController(WmWindow* viewport); | 27 explicit WorkspaceController(WmWindow* viewport); |
| 28 ~WorkspaceController() override; | 28 ~WorkspaceController() override; |
| 29 | 29 |
| 30 // Returns the current window state. | 30 // Returns the current window state. |
| 31 wm::WorkspaceWindowState GetWindowState() const; | 31 wm::WorkspaceWindowState GetWindowState() const; |
| 32 | 32 |
| 33 // Starts the animation that occurs on first login. | 33 // Starts the animation that occurs on first login. |
| 34 void DoInitialAnimation(); | 34 void DoInitialAnimation(); |
| 35 | 35 |
| 36 // Add a delegate which adds a backdrop behind the top window of the default | 36 // Add a delegate which adds a backdrop behind the top window of the default |
| 37 // workspace. | 37 // workspace. |
| 38 void SetMaximizeBackdropDelegate( | 38 void SetMaximizeBackdropDelegate( |
| 39 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate); | 39 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate); |
| 40 | 40 |
| 41 WorkspaceLayoutManager* layout_manager() { return layout_manager_; } | 41 WorkspaceLayoutManager* layout_manager() { return layout_manager_; } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 friend class WorkspaceControllerTestHelper; | 44 friend class WorkspaceControllerTestHelper; |
| 45 | 45 |
| 46 // WmWindowObserver: | 46 // aura::WindowObserver: |
| 47 void OnWindowDestroying(WmWindow* window) override; | 47 void OnWindowDestroying(aura::Window* window) override; |
| 48 | 48 |
| 49 WmWindow* viewport_; | 49 WmWindow* viewport_; |
| 50 std::unique_ptr<WorkspaceEventHandler> event_handler_; | 50 std::unique_ptr<WorkspaceEventHandler> event_handler_; |
| 51 | 51 |
| 52 // Owned by |viewport_|. | 52 // Owned by |viewport_|. |
| 53 WorkspaceLayoutManager* layout_manager_; | 53 WorkspaceLayoutManager* layout_manager_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); | 55 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace ash | 58 } // namespace ash |
| 59 | 59 |
| 60 #endif // ASH_COMMON_WM_WORKSPACE_CONTROLLER_H_ | 60 #endif // ASH_COMMON_WM_WORKSPACE_CONTROLLER_H_ |
| OLD | NEW |