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

Side by Side Diff: ash/common/wm_shell.h

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 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
« no previous file with comments | « ash/common/wm/window_cycle_list.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_COMMON_WM_SHELL_H_ 5 #ifndef ASH_COMMON_WM_SHELL_H_
6 #define ASH_COMMON_WM_SHELL_H_ 6 #define ASH_COMMON_WM_SHELL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 26 matching lines...) Expand all
37 37
38 namespace ash { 38 namespace ash {
39 class AcceleratorController; 39 class AcceleratorController;
40 class ImmersiveFullscreenController; 40 class ImmersiveFullscreenController;
41 class KeyEventWatcher; 41 class KeyEventWatcher;
42 class KeyboardUI; 42 class KeyboardUI;
43 class RootWindowController; 43 class RootWindowController;
44 class ScopedDisableInternalMouseAndKeyboard; 44 class ScopedDisableInternalMouseAndKeyboard;
45 class SessionStateDelegate; 45 class SessionStateDelegate;
46 struct ShellInitParams; 46 struct ShellInitParams;
47 class ShutdownController;
48 class SystemTrayNotifier;
49 class VpnList;
50 class WindowCycleController;
51 class WindowCycleEventFilter; 47 class WindowCycleEventFilter;
52 class WindowResizer; 48 class WindowResizer;
53 class WindowSelectorController;
54 class WmDisplayObserver; 49 class WmDisplayObserver;
55 class WmWindow; 50 class WmWindow;
56 class WorkspaceEventHandler; 51 class WorkspaceEventHandler;
57 52
58 enum class LoginStatus; 53 enum class LoginStatus;
59 enum class TaskSwitchSource; 54 enum class TaskSwitchSource;
60 55
61 namespace wm { 56 namespace wm {
62 class MaximizeModeEventHandler; 57 class MaximizeModeEventHandler;
63 class WindowState; 58 class WindowState;
64 } 59 }
65 60
66 // Similar to ash::Shell. Eventually the two will be merged. 61 // Similar to ash::Shell. Eventually the two will be merged.
67 class ASH_EXPORT WmShell { 62 class ASH_EXPORT WmShell {
68 public: 63 public:
69 virtual ~WmShell(); 64 virtual ~WmShell();
70 65
71 static WmShell* Get(); 66 static WmShell* Get();
72 static bool HasInstance() { return instance_ != nullptr; } 67 static bool HasInstance() { return instance_ != nullptr; }
73 68
74 virtual void Shutdown(); 69 virtual void Shutdown();
75 70
76 ShutdownController* shutdown_controller() {
77 return shutdown_controller_.get();
78 }
79
80 SystemTrayNotifier* system_tray_notifier() {
81 return system_tray_notifier_.get();
82 }
83
84 VpnList* vpn_list() { return vpn_list_.get(); }
85
86 WindowCycleController* window_cycle_controller() {
87 return window_cycle_controller_.get();
88 }
89
90 WindowSelectorController* window_selector_controller() {
91 return window_selector_controller_.get();
92 }
93
94 // Returns true when ash is running as a service_manager::Service. 71 // Returns true when ash is running as a service_manager::Service.
95 virtual bool IsRunningInMash() const = 0; 72 virtual bool IsRunningInMash() const = 0;
96 73
97 virtual WmWindow* GetFocusedWindow() = 0; 74 virtual WmWindow* GetFocusedWindow() = 0;
98 virtual WmWindow* GetActiveWindow() = 0; 75 virtual WmWindow* GetActiveWindow() = 0;
99 76
100 virtual WmWindow* GetCaptureWindow() = 0; 77 virtual WmWindow* GetCaptureWindow() = 0;
101 78
102 // Convenience for GetPrimaryRootWindow()->GetRootWindowController(). 79 // Convenience for GetPrimaryRootWindow()->GetRootWindowController().
103 RootWindowController* GetPrimaryRootWindowController(); 80 RootWindowController* GetPrimaryRootWindowController();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 225
249 // Called during startup to create the primary WindowTreeHost and 226 // Called during startup to create the primary WindowTreeHost and
250 // the corresponding RootWindowController. 227 // the corresponding RootWindowController.
251 virtual void CreatePrimaryHost() = 0; 228 virtual void CreatePrimaryHost() = 0;
252 virtual void InitHosts(const ShellInitParams& init_params) = 0; 229 virtual void InitHosts(const ShellInitParams& init_params) = 0;
253 230
254 // Called during startup to create the AcceleratorController. 231 // Called during startup to create the AcceleratorController.
255 virtual std::unique_ptr<AcceleratorController> 232 virtual std::unique_ptr<AcceleratorController>
256 CreateAcceleratorController() = 0; 233 CreateAcceleratorController() = 0;
257 234
258 void DeleteWindowCycleController();
259
260 void DeleteWindowSelectorController();
261
262 private: 235 private:
263 friend class AcceleratorControllerTest; 236 friend class AcceleratorControllerTest;
264 friend class Shell; 237 friend class Shell;
265 238
266 static WmShell* instance_; 239 static WmShell* instance_;
267 240
268 std::unique_ptr<ShutdownController> shutdown_controller_;
269 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
270 std::unique_ptr<VpnList> vpn_list_;
271 std::unique_ptr<WindowCycleController> window_cycle_controller_;
272 std::unique_ptr<WindowSelectorController> window_selector_controller_;
273
274 base::ObserverList<LockStateObserver> lock_state_observers_; 241 base::ObserverList<LockStateObserver> lock_state_observers_;
275 242
276 bool simulate_modal_window_open_for_testing_ = false; 243 bool simulate_modal_window_open_for_testing_ = false;
277 }; 244 };
278 245
279 } // namespace ash 246 } // namespace ash
280 247
281 #endif // ASH_COMMON_WM_SHELL_H_ 248 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/wm/window_cycle_list.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698