Chromium Code Reviews| Index: ash/common/wm_root_window_controller.h |
| diff --git a/ash/common/wm_root_window_controller.h b/ash/common/wm_root_window_controller.h |
| index 792b01e742e725196b781d2bdf5980ed1e6414fc..fa4109c50b085e6b37b6eb927cf7fa59a329745d 100644 |
| --- a/ash/common/wm_root_window_controller.h |
| +++ b/ash/common/wm_root_window_controller.h |
| @@ -7,6 +7,8 @@ |
| #include "ash/ash_export.h" |
| #include "ash/common/wm/workspace/workspace_types.h" |
| +#include "base/macros.h" |
| +#include "base/observer_list.h" |
| #include "ui/views/widget/widget.h" |
| namespace gfx { |
| @@ -20,23 +22,34 @@ class WmShelf; |
| class WmShell; |
| class WmRootWindowControllerObserver; |
| class WmWindow; |
| -class WorkspaceLayoutManagerBackdropDelegate; |
| +class WorkspaceController; |
| + |
| +namespace wm { |
| +class RootWindowLayoutManager; |
| +} |
| // Provides state associated with a root of a window hierarchy. |
| class ASH_EXPORT WmRootWindowController { |
| public: |
| - virtual ~WmRootWindowController() {} |
| + explicit WmRootWindowController(WmWindow* window); |
| + virtual ~WmRootWindowController(); |
| - virtual bool HasShelf() = 0; |
| + wm::RootWindowLayoutManager* root_window_layout() { |
|
msw
2016/08/30 21:26:46
nit: root_window_layout_manager? (ditto for member
sky
2016/08/30 22:02:56
Done.
|
| + return root_window_layout_; |
| + } |
| - virtual WmShell* GetShell() = 0; |
| + WorkspaceController* workspace_controller() { |
| + return workspace_controller_.get(); |
| + } |
| - virtual wm::WorkspaceWindowState GetWorkspaceWindowState() = 0; |
| + wm::WorkspaceWindowState GetWorkspaceWindowState(); |
| - // TODO: remove when WorkspaceController moved to common: |
| - // http://crbug.com/624173. |
| - virtual void SetMaximizeBackdropDelegate( |
| - std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate) = 0; |
| + void AddObserver(WmRootWindowControllerObserver* observer); |
| + void RemoveObserver(WmRootWindowControllerObserver* observer); |
| + |
| + virtual bool HasShelf() = 0; |
| + |
| + virtual WmShell* GetShell() = 0; |
| virtual AlwaysOnTopController* GetAlwaysOnTopController() = 0; |
| @@ -63,8 +76,29 @@ class ASH_EXPORT WmRootWindowController { |
| // coordinates. This may return a point outside the root window's bounds. |
| virtual gfx::Point GetLastMouseLocationInRoot() = 0; |
| - virtual void AddObserver(WmRootWindowControllerObserver* observer) = 0; |
| - virtual void RemoveObserver(WmRootWindowControllerObserver* observer) = 0; |
| + protected: |
| + // Creates the containers (WmWindows) used by the shell. |
| + void CreateContainers(); |
| + |
| + // Creates the LayoutManagers for the windows created by CreateContainers(). |
| + void CreateLayoutManagers(); |
| + |
| + void DeleteWorkspaceController(); |
| + |
| + base::ObserverList<WmRootWindowControllerObserver>* observers() { |
| + return &observers_; |
| + } |
| + |
| + private: |
| + WmWindow* root_; |
| + |
| + wm::RootWindowLayoutManager* root_window_layout_; |
| + |
| + std::unique_ptr<WorkspaceController> workspace_controller_; |
| + |
| + base::ObserverList<WmRootWindowControllerObserver> observers_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WmRootWindowController); |
| }; |
| } // namespace ash |