Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: ash/mus/bridge/wm_shell_mus.h

Issue 2633293005: Converts mash to use Shell (Closed)
Patch Set: cleanup Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "base/observer_list.h"
16 #include "ui/wm/public/activation_change_observer.h"
17 15
18 namespace aura { 16 namespace aura {
19 class WindowTreeClient; 17 class WindowTreeClient;
20 } 18 }
21 19
22 namespace views { 20 namespace views {
23 class PointerWatcherEventRouter; 21 class PointerWatcherEventRouter;
24 } 22 }
25 23
26 namespace ash { 24 namespace ash {
27 namespace mus { 25 namespace mus {
28 26
29 class AcceleratorControllerDelegateMus; 27 class AcceleratorControllerDelegateMus;
30 class AcceleratorControllerRegistrar; 28 class AcceleratorControllerRegistrar;
31 class ImmersiveHandlerFactoryMus; 29 class ImmersiveHandlerFactoryMus;
32 class RootWindowController; 30 class RootWindowController;
33 class WindowManager; 31 class WindowManager;
34 class WmShellMusTestApi; 32 class WmShellMusTestApi;
35 33
36 // WmShell implementation for mus. 34 // WmShell implementation for mus.
37 class WmShellMus : public WmShell, 35 class WmShellMus : public WmShell {
38 public aura::client::ActivationChangeObserver {
39 public: 36 public:
40 WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate, 37 WmShellMus(WmWindow* primary_window,
38 std::unique_ptr<ShellDelegate> shell_delegate,
41 WindowManager* window_manager, 39 WindowManager* window_manager,
42 views::PointerWatcherEventRouter* pointer_watcher_event_router); 40 views::PointerWatcherEventRouter* pointer_watcher_event_router);
43 ~WmShellMus() override; 41 ~WmShellMus() override;
44 42
45 static WmShellMus* Get(); 43 static WmShellMus* Get();
46 44
47 void AddRootWindowController(RootWindowController* controller);
48 void RemoveRootWindowController(RootWindowController* controller);
49
50 RootWindowController* GetRootWindowControllerWithDisplayId(int64_t id); 45 RootWindowController* GetRootWindowControllerWithDisplayId(int64_t id);
51 46
52 AcceleratorControllerDelegateMus* accelerator_controller_delegate() { 47 AcceleratorControllerDelegateMus* accelerator_controller_delegate() {
53 return accelerator_controller_delegate_.get(); 48 return accelerator_controller_delegate_.get();
54 } 49 }
55 50
56 aura::WindowTreeClient* window_tree_client(); 51 aura::WindowTreeClient* window_tree_client();
57 52
58 WindowManager* window_manager() { return window_manager_; } 53 WindowManager* window_manager() { return window_manager_; }
59 54
60 // WmShell: 55 // WmShell:
56 void Initialize(
57 const scoped_refptr<base::SequencedWorkerPool>& pool) override;
58 void Shutdown() override;
61 bool IsRunningInMash() const override; 59 bool IsRunningInMash() const override;
62 WmWindow* NewWindow(ui::wm::WindowType window_type, 60 WmWindow* NewWindow(ui::wm::WindowType window_type,
63 ui::LayerType layer_type) override; 61 ui::LayerType layer_type) override;
64 WmWindow* GetFocusedWindow() override; 62 WmWindow* GetFocusedWindow() override;
65 WmWindow* GetActiveWindow() override; 63 WmWindow* GetActiveWindow() override;
66 WmWindow* GetCaptureWindow() override; 64 WmWindow* GetCaptureWindow() override;
67 WmWindow* GetPrimaryRootWindow() override; 65 WmWindow* GetPrimaryRootWindow() override;
68 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; 66 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override;
69 const display::ManagedDisplayInfo& GetDisplayInfo( 67 const display::ManagedDisplayInfo& GetDisplayInfo(
70 int64_t display_id) const override; 68 int64_t display_id) const override;
(...skipping 23 matching lines...) Expand all
94 std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler( 92 std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler(
95 WmWindow* workspace_window) override; 93 WmWindow* workspace_window) override;
96 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> 94 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard>
97 CreateScopedDisableInternalMouseAndKeyboard() override; 95 CreateScopedDisableInternalMouseAndKeyboard() override;
98 std::unique_ptr<ImmersiveFullscreenController> 96 std::unique_ptr<ImmersiveFullscreenController>
99 CreateImmersiveFullscreenController() override; 97 CreateImmersiveFullscreenController() override;
100 std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() override; 98 std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() override;
101 void OnOverviewModeStarting() override; 99 void OnOverviewModeStarting() override;
102 void OnOverviewModeEnded() override; 100 void OnOverviewModeEnded() override;
103 SessionStateDelegate* GetSessionStateDelegate() override; 101 SessionStateDelegate* GetSessionStateDelegate() override;
104 void AddActivationObserver(WmActivationObserver* observer) override;
105 void RemoveActivationObserver(WmActivationObserver* observer) override;
106 void AddDisplayObserver(WmDisplayObserver* observer) override; 102 void AddDisplayObserver(WmDisplayObserver* observer) override;
107 void RemoveDisplayObserver(WmDisplayObserver* observer) override; 103 void RemoveDisplayObserver(WmDisplayObserver* observer) override;
108 void AddPointerWatcher(views::PointerWatcher* watcher, 104 void AddPointerWatcher(views::PointerWatcher* watcher,
109 views::PointerWatcherEventTypes events) override; 105 views::PointerWatcherEventTypes events) override;
110 void RemovePointerWatcher(views::PointerWatcher* watcher) override; 106 void RemovePointerWatcher(views::PointerWatcher* watcher) override;
111 void RequestShutdown() override; 107 void RequestShutdown() override;
112 bool IsTouchDown() override; 108 bool IsTouchDown() override;
113 void ToggleIgnoreExternalKeyboard() override; 109 void ToggleIgnoreExternalKeyboard() override;
114 void SetLaserPointerEnabled(bool enabled) override; 110 void SetLaserPointerEnabled(bool enabled) override;
111 void CreatePointerWatcherAdapter() override;
112 void CreatePrimaryHost() override;
113 void InitHosts(const ShellInitParams& init_params) override;
115 114
116 private: 115 private:
117 friend class WmShellMusTestApi; 116 friend class WmShellMusTestApi;
118 117
119 // aura::client::ActivationChangeObserver:
120 void OnWindowActivated(ActivationReason reason,
121 aura::Window* gained_active,
122 aura::Window* lost_active) override;
123
124 WindowManager* window_manager_; 118 WindowManager* window_manager_;
125 119
120 WmWindow* primary_window_;
James Cook 2017/01/18 01:00:24 nit: maybe primary_root_window_ ?
sky 2017/01/18 04:00:07 Done.
126 views::PointerWatcherEventRouter* pointer_watcher_event_router_; 121 views::PointerWatcherEventRouter* pointer_watcher_event_router_;
127 122
128 std::vector<RootWindowController*> root_window_controllers_;
129
130 std::unique_ptr<AcceleratorControllerDelegateMus> 123 std::unique_ptr<AcceleratorControllerDelegateMus>
131 accelerator_controller_delegate_; 124 accelerator_controller_delegate_;
132 std::unique_ptr<AcceleratorControllerRegistrar> 125 std::unique_ptr<AcceleratorControllerRegistrar>
133 accelerator_controller_registrar_; 126 accelerator_controller_registrar_;
134 std::unique_ptr<ImmersiveHandlerFactoryMus> immersive_handler_factory_; 127 std::unique_ptr<ImmersiveHandlerFactoryMus> immersive_handler_factory_;
135 std::unique_ptr<SessionStateDelegate> session_state_delegate_; 128 std::unique_ptr<SessionStateDelegate> session_state_delegate_;
136 129
137 base::ObserverList<WmActivationObserver> activation_observers_;
138
139 DISALLOW_COPY_AND_ASSIGN(WmShellMus); 130 DISALLOW_COPY_AND_ASSIGN(WmShellMus);
140 }; 131 };
141 132
142 } // namespace mus 133 } // namespace mus
143 } // namespace ash 134 } // namespace ash
144 135
145 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ 136 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_
OLDNEW
« no previous file with comments | « ash/mus/BUILD.gn ('k') | ash/mus/bridge/wm_shell_mus.cc » ('j') | ash/mus/bridge/wm_shell_mus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698