| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | |
| 6 #define ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "ash/wm_shell.h" | |
| 14 #include "base/macros.h" | |
| 15 | |
| 16 namespace aura { | |
| 17 class WindowTreeClient; | |
| 18 } | |
| 19 | |
| 20 namespace views { | |
| 21 class PointerWatcherEventRouter; | |
| 22 } | |
| 23 | |
| 24 namespace ash { | |
| 25 | |
| 26 class AcceleratorControllerDelegateAura; | |
| 27 class PointerWatcherAdapter; | |
| 28 class RootWindowController; | |
| 29 | |
| 30 namespace mus { | |
| 31 | |
| 32 class AcceleratorControllerDelegateMus; | |
| 33 class AcceleratorControllerRegistrar; | |
| 34 class ImmersiveHandlerFactoryMus; | |
| 35 class WindowManager; | |
| 36 class WmShellMusTestApi; | |
| 37 | |
| 38 // WmShell implementation for mus. | |
| 39 class WmShellMus : public WmShell { | |
| 40 public: | |
| 41 // If |create_session_state_delegate_stub| is true SessionStateDelegateStub is | |
| 42 // created. If false, the SessionStateDelegate from Shell is used. | |
| 43 WmShellMus(WmWindow* primary_root_window, | |
| 44 WindowManager* window_manager, | |
| 45 views::PointerWatcherEventRouter* pointer_watcher_event_router, | |
| 46 bool create_session_state_delegate_stub); | |
| 47 ~WmShellMus() override; | |
| 48 | |
| 49 static WmShellMus* Get(); | |
| 50 | |
| 51 ash::RootWindowController* GetRootWindowControllerWithDisplayId(int64_t id); | |
| 52 | |
| 53 AcceleratorControllerDelegateAura* accelerator_controller_delegate_mus() { | |
| 54 return mus_state_->accelerator_controller_delegate.get(); | |
| 55 } | |
| 56 | |
| 57 aura::WindowTreeClient* window_tree_client(); | |
| 58 | |
| 59 WindowManager* window_manager() { return window_manager_; } | |
| 60 | |
| 61 // WmShell: | |
| 62 void Shutdown() override; | |
| 63 bool IsRunningInMash() const override; | |
| 64 Config GetAshConfig() const override; | |
| 65 WmWindow* GetPrimaryRootWindow() override; | |
| 66 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; | |
| 67 const display::ManagedDisplayInfo& GetDisplayInfo( | |
| 68 int64_t display_id) const override; | |
| 69 bool IsActiveDisplayId(int64_t display_id) const override; | |
| 70 display::Display GetFirstDisplay() const override; | |
| 71 bool IsInUnifiedMode() const override; | |
| 72 bool IsInUnifiedModeIgnoreMirroring() const override; | |
| 73 void SetDisplayWorkAreaInsets(WmWindow* window, | |
| 74 const gfx::Insets& insets) override; | |
| 75 void LockCursor() override; | |
| 76 void UnlockCursor() override; | |
| 77 bool IsMouseEventsEnabled() override; | |
| 78 std::vector<WmWindow*> GetAllRootWindows() override; | |
| 79 void RecordGestureAction(GestureActionType action) override; | |
| 80 void RecordUserMetricsAction(UserMetricsAction action) override; | |
| 81 void RecordTaskSwitchMetric(TaskSwitchSource source) override; | |
| 82 std::unique_ptr<WindowResizer> CreateDragWindowResizer( | |
| 83 std::unique_ptr<WindowResizer> next_window_resizer, | |
| 84 wm::WindowState* window_state) override; | |
| 85 std::unique_ptr<WindowCycleEventFilter> CreateWindowCycleEventFilter() | |
| 86 override; | |
| 87 std::unique_ptr<wm::MaximizeModeEventHandler> CreateMaximizeModeEventHandler() | |
| 88 override; | |
| 89 std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler( | |
| 90 WmWindow* workspace_window) override; | |
| 91 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> | |
| 92 CreateScopedDisableInternalMouseAndKeyboard() override; | |
| 93 std::unique_ptr<ImmersiveFullscreenController> | |
| 94 CreateImmersiveFullscreenController() override; | |
| 95 std::unique_ptr<KeyboardUI> CreateKeyboardUI() override; | |
| 96 std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() override; | |
| 97 SessionStateDelegate* GetSessionStateDelegate() override; | |
| 98 void AddDisplayObserver(WmDisplayObserver* observer) override; | |
| 99 void RemoveDisplayObserver(WmDisplayObserver* observer) override; | |
| 100 void AddPointerWatcher(views::PointerWatcher* watcher, | |
| 101 views::PointerWatcherEventTypes events) override; | |
| 102 void RemovePointerWatcher(views::PointerWatcher* watcher) override; | |
| 103 bool IsTouchDown() override; | |
| 104 void ToggleIgnoreExternalKeyboard() override; | |
| 105 void SetLaserPointerEnabled(bool enabled) override; | |
| 106 void SetPartialMagnifierEnabled(bool enabled) override; | |
| 107 void CreatePointerWatcherAdapter() override; | |
| 108 void CreatePrimaryHost() override; | |
| 109 void InitHosts(const ShellInitParams& init_params) override; | |
| 110 std::unique_ptr<AcceleratorController> CreateAcceleratorController() override; | |
| 111 | |
| 112 private: | |
| 113 friend class WmShellMusTestApi; | |
| 114 | |
| 115 struct MashSpecificState { | |
| 116 MashSpecificState(); | |
| 117 ~MashSpecificState(); | |
| 118 | |
| 119 views::PointerWatcherEventRouter* pointer_watcher_event_router = nullptr; | |
| 120 std::unique_ptr<AcceleratorControllerDelegateMus> | |
| 121 accelerator_controller_delegate; | |
| 122 std::unique_ptr<AcceleratorControllerRegistrar> | |
| 123 accelerator_controller_registrar; | |
| 124 std::unique_ptr<ImmersiveHandlerFactoryMus> immersive_handler_factory; | |
| 125 }; | |
| 126 | |
| 127 struct MusSpecificState { | |
| 128 MusSpecificState(); | |
| 129 ~MusSpecificState(); | |
| 130 | |
| 131 std::unique_ptr<PointerWatcherAdapter> pointer_watcher_adapter; | |
| 132 std::unique_ptr<AcceleratorControllerDelegateAura> | |
| 133 accelerator_controller_delegate; | |
| 134 }; | |
| 135 | |
| 136 WindowManager* window_manager_; | |
| 137 | |
| 138 WmWindow* primary_root_window_; | |
| 139 | |
| 140 // Only one of |mash_state_| or |mus_state_| is created, depending upon | |
| 141 // Config. | |
| 142 std::unique_ptr<MashSpecificState> mash_state_; | |
| 143 std::unique_ptr<MusSpecificState> mus_state_; | |
| 144 | |
| 145 std::unique_ptr<SessionStateDelegate> session_state_delegate_; | |
| 146 | |
| 147 DISALLOW_COPY_AND_ASSIGN(WmShellMus); | |
| 148 }; | |
| 149 | |
| 150 } // namespace mus | |
| 151 } // namespace ash | |
| 152 | |
| 153 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | |
| OLD | NEW |