| 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_SHELL_PORT_MASH_H_ | 5 #ifndef ASH_MUS_BRIDGE_SHELL_PORT_MASH_H_ |
| 6 #define ASH_MUS_BRIDGE_SHELL_PORT_MASH_H_ | 6 #define ASH_MUS_BRIDGE_SHELL_PORT_MASH_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/display/window_tree_host_manager.h" |
| 13 #include "ash/shell_port.h" | 14 #include "ash/shell_port.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 | 16 |
| 16 namespace aura { | 17 namespace aura { |
| 17 class WindowTreeClient; | 18 class WindowTreeClient; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace views { | 21 namespace views { |
| 21 class PointerWatcherEventRouter; | 22 class PointerWatcherEventRouter; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace ash { | 25 namespace ash { |
| 25 | 26 |
| 26 class AcceleratorControllerDelegateAura; | 27 class AcceleratorControllerDelegateAura; |
| 27 class PointerWatcherAdapter; | 28 class PointerWatcherAdapter; |
| 28 class RootWindowController; | 29 class RootWindowController; |
| 29 | 30 |
| 30 namespace mus { | 31 namespace mus { |
| 31 | 32 |
| 32 class AcceleratorControllerDelegateMus; | 33 class AcceleratorControllerDelegateMus; |
| 33 class AcceleratorControllerRegistrar; | 34 class AcceleratorControllerRegistrar; |
| 34 class ImmersiveHandlerFactoryMus; | 35 class ImmersiveHandlerFactoryMus; |
| 35 class WindowManager; | 36 class WindowManager; |
| 36 class ShellPortMashTestApi; | 37 class ShellPortMashTestApi; |
| 37 | 38 |
| 38 // ShellPort implementation for mash/mus. See ash/README.md for more. | 39 // ShellPort implementation for mash/mus. See ash/README.md for more. |
| 39 class ShellPortMash : public ShellPort { | 40 class ShellPortMash : public ShellPort, public WindowTreeHostManager::Observer { |
| 40 public: | 41 public: |
| 41 // If |create_session_state_delegate_stub| is true SessionStateDelegateStub is | 42 // If |create_session_state_delegate_stub| is true SessionStateDelegateStub is |
| 42 // created. If false, the SessionStateDelegate from Shell is used. | 43 // created. If false, the SessionStateDelegate from Shell is used. |
| 43 ShellPortMash(WmWindow* primary_root_window, | 44 ShellPortMash(WmWindow* primary_root_window, |
| 44 WindowManager* window_manager, | 45 WindowManager* window_manager, |
| 45 views::PointerWatcherEventRouter* pointer_watcher_event_router, | 46 views::PointerWatcherEventRouter* pointer_watcher_event_router, |
| 46 bool create_session_state_delegate_stub); | 47 bool create_session_state_delegate_stub); |
| 47 ~ShellPortMash() override; | 48 ~ShellPortMash() override; |
| 48 | 49 |
| 49 static ShellPortMash* Get(); | 50 static ShellPortMash* Get(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 132 |
| 132 struct MusSpecificState { | 133 struct MusSpecificState { |
| 133 MusSpecificState(); | 134 MusSpecificState(); |
| 134 ~MusSpecificState(); | 135 ~MusSpecificState(); |
| 135 | 136 |
| 136 std::unique_ptr<PointerWatcherAdapter> pointer_watcher_adapter; | 137 std::unique_ptr<PointerWatcherAdapter> pointer_watcher_adapter; |
| 137 std::unique_ptr<AcceleratorControllerDelegateAura> | 138 std::unique_ptr<AcceleratorControllerDelegateAura> |
| 138 accelerator_controller_delegate; | 139 accelerator_controller_delegate; |
| 139 }; | 140 }; |
| 140 | 141 |
| 142 // WindowTreeHostManager::Observer: |
| 143 void OnDisplayConfigurationChanging() override; |
| 144 void OnDisplayConfigurationChanged() override; |
| 145 |
| 141 WindowManager* window_manager_; | 146 WindowManager* window_manager_; |
| 142 | 147 |
| 143 // TODO(sky): remove this once mash supports simple display management. | 148 // TODO(sky): remove this once mash supports simple display management. |
| 144 WmWindow* primary_root_window_; | 149 WmWindow* primary_root_window_; |
| 145 | 150 |
| 146 // Only one of |mash_state_| or |mus_state_| is created, depending upon | 151 // Only one of |mash_state_| or |mus_state_| is created, depending upon |
| 147 // Config. | 152 // Config. |
| 148 std::unique_ptr<MashSpecificState> mash_state_; | 153 std::unique_ptr<MashSpecificState> mash_state_; |
| 149 std::unique_ptr<MusSpecificState> mus_state_; | 154 std::unique_ptr<MusSpecificState> mus_state_; |
| 150 | 155 |
| 151 std::unique_ptr<SessionStateDelegate> session_state_delegate_; | 156 std::unique_ptr<SessionStateDelegate> session_state_delegate_; |
| 152 | 157 |
| 158 bool added_display_observer_ = false; |
| 159 base::ObserverList<WmDisplayObserver> display_observers_; |
| 160 |
| 153 DISALLOW_COPY_AND_ASSIGN(ShellPortMash); | 161 DISALLOW_COPY_AND_ASSIGN(ShellPortMash); |
| 154 }; | 162 }; |
| 155 | 163 |
| 156 } // namespace mus | 164 } // namespace mus |
| 157 } // namespace ash | 165 } // namespace ash |
| 158 | 166 |
| 159 #endif // ASH_MUS_BRIDGE_SHELL_PORT_MASH_H_ | 167 #endif // ASH_MUS_BRIDGE_SHELL_PORT_MASH_H_ |
| OLD | NEW |