| OLD | NEW | 
|    1 // Copyright 2016 The Chromium Authors. All rights reserved. |    1 // Copyright 2016 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_ROOT_WINDOW_CONTROLLER_H_ |    5 #ifndef ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ | 
|    6 #define ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ |    6 #define ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ | 
|    7  |    7  | 
|    8 #include "ash/ash_export.h" |    8 #include "ash/ash_export.h" | 
|    9 #include "ash/common/wm/workspace/workspace_types.h" |    9 #include "ash/common/wm/workspace/workspace_types.h" | 
|   10 #include "base/macros.h" |   10 #include "base/macros.h" | 
|   11 #include "base/observer_list.h" |  | 
|   12 #include "ui/views/widget/widget.h" |   11 #include "ui/views/widget/widget.h" | 
|   13  |   12  | 
|   14 namespace gfx { |   13 namespace gfx { | 
|   15 class Point; |   14 class Point; | 
|   16 } |   15 } | 
|   17  |   16  | 
|   18 namespace ash { |   17 namespace ash { | 
|   19  |   18  | 
|   20 class AlwaysOnTopController; |   19 class AlwaysOnTopController; | 
|   21 class WmShelf; |   20 class WmShelf; | 
|   22 class WmShell; |   21 class WmShell; | 
|   23 class WmRootWindowControllerObserver; |  | 
|   24 class WmWindow; |   22 class WmWindow; | 
|   25 class WorkspaceController; |   23 class WorkspaceController; | 
|   26  |   24  | 
|   27 namespace wm { |   25 namespace wm { | 
|   28 class RootWindowLayoutManager; |   26 class RootWindowLayoutManager; | 
|   29 } |   27 } | 
|   30  |   28  | 
|   31 // Provides state associated with a root of a window hierarchy. |   29 // Provides state associated with a root of a window hierarchy. | 
|   32 class ASH_EXPORT WmRootWindowController { |   30 class ASH_EXPORT WmRootWindowController { | 
|   33  public: |   31  public: | 
|   34   explicit WmRootWindowController(WmWindow* window); |   32   explicit WmRootWindowController(WmWindow* window); | 
|   35   virtual ~WmRootWindowController(); |   33   virtual ~WmRootWindowController(); | 
|   36  |   34  | 
|   37   wm::RootWindowLayoutManager* root_window_layout_manager() { |   35   wm::RootWindowLayoutManager* root_window_layout_manager() { | 
|   38     return root_window_layout_manager_; |   36     return root_window_layout_manager_; | 
|   39   } |   37   } | 
|   40  |   38  | 
|   41   WorkspaceController* workspace_controller() { |   39   WorkspaceController* workspace_controller() { | 
|   42     return workspace_controller_.get(); |   40     return workspace_controller_.get(); | 
|   43   } |   41   } | 
|   44  |   42  | 
|   45   wm::WorkspaceWindowState GetWorkspaceWindowState(); |   43   wm::WorkspaceWindowState GetWorkspaceWindowState(); | 
|   46  |   44  | 
|   47   void AddObserver(WmRootWindowControllerObserver* observer); |  | 
|   48   void RemoveObserver(WmRootWindowControllerObserver* observer); |  | 
|   49  |  | 
|   50   virtual bool HasShelf() = 0; |   45   virtual bool HasShelf() = 0; | 
|   51  |   46  | 
|   52   virtual WmShell* GetShell() = 0; |   47   virtual WmShell* GetShell() = 0; | 
|   53  |   48  | 
|   54   virtual AlwaysOnTopController* GetAlwaysOnTopController() = 0; |   49   virtual AlwaysOnTopController* GetAlwaysOnTopController() = 0; | 
|   55  |   50  | 
|   56   virtual WmShelf* GetShelf() = 0; |   51   virtual WmShelf* GetShelf() = 0; | 
|   57  |   52  | 
|   58   // Returns the window associated with this WmRootWindowController. |   53   // Returns the window associated with this WmRootWindowController. | 
|   59   virtual WmWindow* GetWindow() = 0; |   54   virtual WmWindow* GetWindow() = 0; | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
|   78  |   73  | 
|   79  protected: |   74  protected: | 
|   80   // Creates the containers (WmWindows) used by the shell. |   75   // Creates the containers (WmWindows) used by the shell. | 
|   81   void CreateContainers(); |   76   void CreateContainers(); | 
|   82  |   77  | 
|   83   // Creates the LayoutManagers for the windows created by CreateContainers(). |   78   // Creates the LayoutManagers for the windows created by CreateContainers(). | 
|   84   void CreateLayoutManagers(); |   79   void CreateLayoutManagers(); | 
|   85  |   80  | 
|   86   void DeleteWorkspaceController(); |   81   void DeleteWorkspaceController(); | 
|   87  |   82  | 
|   88   base::ObserverList<WmRootWindowControllerObserver>* observers() { |  | 
|   89     return &observers_; |  | 
|   90   } |  | 
|   91  |  | 
|   92  private: |   83  private: | 
|   93   WmWindow* root_; |   84   WmWindow* root_; | 
|   94  |   85  | 
|   95   wm::RootWindowLayoutManager* root_window_layout_manager_; |   86   wm::RootWindowLayoutManager* root_window_layout_manager_; | 
|   96  |   87  | 
|   97   std::unique_ptr<WorkspaceController> workspace_controller_; |   88   std::unique_ptr<WorkspaceController> workspace_controller_; | 
|   98  |   89  | 
|   99   base::ObserverList<WmRootWindowControllerObserver> observers_; |  | 
|  100  |  | 
|  101   DISALLOW_COPY_AND_ASSIGN(WmRootWindowController); |   90   DISALLOW_COPY_AND_ASSIGN(WmRootWindowController); | 
|  102 }; |   91 }; | 
|  103  |   92  | 
|  104 }  // namespace ash |   93 }  // namespace ash | 
|  105  |   94  | 
|  106 #endif  // ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ |   95 #endif  // ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ | 
| OLD | NEW |