| 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_MUS_BRIDGE_WM_SHELL_MUS_H_ | 5 #ifndef ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| 6 #define ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | 6 #define ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 | 15 |
| 16 namespace aura { | 16 namespace aura { |
| 17 class WindowTreeClient; | 17 class WindowTreeClient; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 class PointerWatcherEventRouter; | 21 class PointerWatcherEventRouter; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 | 25 |
| 26 class AcceleratorControllerDelegateAura; | 26 class AcceleratorControllerDelegateAura; |
| 27 class PointerWatcherAdapter; |
| 27 class RootWindowController; | 28 class RootWindowController; |
| 28 | 29 |
| 29 namespace mus { | 30 namespace mus { |
| 30 | 31 |
| 31 class AcceleratorControllerDelegateMus; | 32 class AcceleratorControllerDelegateMus; |
| 32 class AcceleratorControllerRegistrar; | 33 class AcceleratorControllerRegistrar; |
| 33 class ImmersiveHandlerFactoryMus; | 34 class ImmersiveHandlerFactoryMus; |
| 34 class WindowManager; | 35 class WindowManager; |
| 35 class WmShellMusTestApi; | 36 class WmShellMusTestApi; |
| 36 | 37 |
| 37 // WmShell implementation for mus. | 38 // WmShell implementation for mus. |
| 38 class WmShellMus : public WmShell { | 39 class WmShellMus : public WmShell { |
| 39 public: | 40 public: |
| 40 // If |create_session_state_delegate_stub| is true SessionStateDelegateStub is | 41 // If |create_session_state_delegate_stub| is true SessionStateDelegateStub is |
| 41 // created. If false, the SessionStateDelegate from Shell is used. | 42 // created. If false, the SessionStateDelegate from Shell is used. |
| 42 WmShellMus(WmWindow* primary_root_window, | 43 WmShellMus(WmWindow* primary_root_window, |
| 43 WindowManager* window_manager, | 44 WindowManager* window_manager, |
| 44 views::PointerWatcherEventRouter* pointer_watcher_event_router, | 45 views::PointerWatcherEventRouter* pointer_watcher_event_router, |
| 45 bool create_session_state_delegate_stub); | 46 bool create_session_state_delegate_stub); |
| 46 ~WmShellMus() override; | 47 ~WmShellMus() override; |
| 47 | 48 |
| 48 static WmShellMus* Get(); | 49 static WmShellMus* Get(); |
| 49 | 50 |
| 50 ash::RootWindowController* GetRootWindowControllerWithDisplayId(int64_t id); | 51 ash::RootWindowController* GetRootWindowControllerWithDisplayId(int64_t id); |
| 51 | 52 |
| 52 AcceleratorControllerDelegateAura* accelerator_controller_delegate_classic() { | 53 AcceleratorControllerDelegateAura* accelerator_controller_delegate_mus() { |
| 53 return accelerator_controller_delegate_classic_.get(); | 54 return mus_state_->accelerator_controller_delegate.get(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 aura::WindowTreeClient* window_tree_client(); | 57 aura::WindowTreeClient* window_tree_client(); |
| 57 | 58 |
| 58 WindowManager* window_manager() { return window_manager_; } | 59 WindowManager* window_manager() { return window_manager_; } |
| 59 | 60 |
| 60 // WmShell: | 61 // WmShell: |
| 61 void Shutdown() override; | 62 void Shutdown() override; |
| 62 bool IsRunningInMash() const override; | 63 bool IsRunningInMash() const override; |
| 63 Config GetConfig() const override; | 64 Config GetConfig() const override; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 void SetLaserPointerEnabled(bool enabled) override; | 110 void SetLaserPointerEnabled(bool enabled) override; |
| 110 void SetPartialMagnifierEnabled(bool enabled) override; | 111 void SetPartialMagnifierEnabled(bool enabled) override; |
| 111 void CreatePointerWatcherAdapter() override; | 112 void CreatePointerWatcherAdapter() override; |
| 112 void CreatePrimaryHost() override; | 113 void CreatePrimaryHost() override; |
| 113 void InitHosts(const ShellInitParams& init_params) override; | 114 void InitHosts(const ShellInitParams& init_params) override; |
| 114 std::unique_ptr<AcceleratorController> CreateAcceleratorController() override; | 115 std::unique_ptr<AcceleratorController> CreateAcceleratorController() override; |
| 115 | 116 |
| 116 private: | 117 private: |
| 117 friend class WmShellMusTestApi; | 118 friend class WmShellMusTestApi; |
| 118 | 119 |
| 120 struct MashSpecificState { |
| 121 MashSpecificState(); |
| 122 ~MashSpecificState(); |
| 123 |
| 124 views::PointerWatcherEventRouter* pointer_watcher_event_router = nullptr; |
| 125 std::unique_ptr<AcceleratorControllerDelegateMus> |
| 126 accelerator_controller_delegate; |
| 127 std::unique_ptr<AcceleratorControllerRegistrar> |
| 128 accelerator_controller_registrar; |
| 129 std::unique_ptr<ImmersiveHandlerFactoryMus> immersive_handler_factory; |
| 130 }; |
| 131 |
| 132 struct MusSpecificState { |
| 133 MusSpecificState(); |
| 134 ~MusSpecificState(); |
| 135 |
| 136 std::unique_ptr<PointerWatcherAdapter> pointer_watcher_adapter; |
| 137 std::unique_ptr<AcceleratorControllerDelegateAura> |
| 138 accelerator_controller_delegate; |
| 139 }; |
| 140 |
| 119 WindowManager* window_manager_; | 141 WindowManager* window_manager_; |
| 120 | 142 |
| 121 WmWindow* primary_root_window_; | 143 WmWindow* primary_root_window_; |
| 122 views::PointerWatcherEventRouter* pointer_watcher_event_router_; | |
| 123 | 144 |
| 124 // |accelerator_controller_delegate_classic_| is created in MUS mode, | 145 // Only one of |mash_state_| or |mus_state_| is created, depending upon |
| 125 // |accelerator_controller_delegate_| in MASH mode. | 146 // Config. |
| 126 std::unique_ptr<AcceleratorControllerDelegateMus> | 147 std::unique_ptr<MashSpecificState> mash_state_; |
| 127 accelerator_controller_delegate_; | 148 std::unique_ptr<MusSpecificState> mus_state_; |
| 128 std::unique_ptr<AcceleratorControllerDelegateAura> | 149 |
| 129 accelerator_controller_delegate_classic_; | |
| 130 std::unique_ptr<AcceleratorControllerRegistrar> | |
| 131 accelerator_controller_registrar_; | |
| 132 std::unique_ptr<ImmersiveHandlerFactoryMus> immersive_handler_factory_; | |
| 133 std::unique_ptr<SessionStateDelegate> session_state_delegate_; | 150 std::unique_ptr<SessionStateDelegate> session_state_delegate_; |
| 134 | 151 |
| 135 DISALLOW_COPY_AND_ASSIGN(WmShellMus); | 152 DISALLOW_COPY_AND_ASSIGN(WmShellMus); |
| 136 }; | 153 }; |
| 137 | 154 |
| 138 } // namespace mus | 155 } // namespace mus |
| 139 } // namespace ash | 156 } // namespace ash |
| 140 | 157 |
| 141 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | 158 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| OLD | NEW |