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

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

Issue 2118593002: mash: Migrate ShellDelegate ownership and access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 5 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_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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "ash/ash_export.h" 13 #include "ash/ash_export.h"
14 #include "ash/common/media_delegate.h" 14 #include "ash/common/media_delegate.h"
15 #include "ash/common/metrics/user_metrics_action.h" 15 #include "ash/common/metrics/user_metrics_action.h"
16 #include "ash/common/shell_delegate.h"
James Cook 2016/07/06 21:27:27 Can this be forward declared? wm_shell.h is widely
msw 2016/07/06 21:58:55 Done.
16 #include "base/observer_list.h" 17 #include "base/observer_list.h"
17 18
18 namespace gfx { 19 namespace gfx {
19 class Rect; 20 class Rect;
20 } 21 }
21 22
22 namespace views { 23 namespace views {
23 class PointerWatcher; 24 class PointerWatcher;
24 } 25 }
25 26
(...skipping 28 matching lines...) Expand all
54 55
55 // Similar to ash::Shell. Eventually the two will be merged. 56 // Similar to ash::Shell. Eventually the two will be merged.
56 class ASH_EXPORT WmShell { 57 class ASH_EXPORT WmShell {
57 public: 58 public:
58 // This is necessary for a handful of places that is difficult to plumb 59 // This is necessary for a handful of places that is difficult to plumb
59 // through context. 60 // through context.
60 static void Set(WmShell* instance); 61 static void Set(WmShell* instance);
61 static WmShell* Get(); 62 static WmShell* Get();
62 static bool HasInstance() { return instance_ != nullptr; } 63 static bool HasInstance() { return instance_ != nullptr; }
63 64
65 ShellDelegate* delegate() { return delegate_.get(); }
66
64 FocusCycler* focus_cycler() { return focus_cycler_.get(); } 67 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
65 68
66 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } 69 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
67 70
68 MaximizeModeController* maximize_mode_controller() { 71 MaximizeModeController* maximize_mode_controller() {
69 return maximize_mode_controller_.get(); 72 return maximize_mode_controller_.get();
70 } 73 }
71 74
72 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } 75 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
73 76
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 #if defined(OS_CHROMEOS) 203 #if defined(OS_CHROMEOS)
201 LogoutConfirmationController* logout_confirmation_controller() { 204 LogoutConfirmationController* logout_confirmation_controller() {
202 return logout_confirmation_controller_.get(); 205 return logout_confirmation_controller_.get();
203 } 206 }
204 207
205 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. 208 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved.
206 virtual void ToggleIgnoreExternalKeyboard() = 0; 209 virtual void ToggleIgnoreExternalKeyboard() = 0;
207 #endif 210 #endif
208 211
209 protected: 212 protected:
210 WmShell(); 213 explicit WmShell(ShellDelegate* delegate);
211 virtual ~WmShell(); 214 virtual ~WmShell();
212 215
213 base::ObserverList<ShellObserver>* shell_observers() { 216 base::ObserverList<ShellObserver>* shell_observers() {
214 return &shell_observers_; 217 return &shell_observers_;
215 } 218 }
216 219
217 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); 220 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui);
218 221
219 // Helpers to set (and initialize) or destroy various delegates. 222 // Helpers to set (and initialize) or destroy various delegates.
220 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. 223 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported.
224 void DeleteShellDelegate();
James Cook 2016/07/06 21:27:27 I don't see this called in your CL.
msw 2016/07/06 21:58:55 Removed.
221 void SetMediaDelegate(std::unique_ptr<MediaDelegate> delegate); 225 void SetMediaDelegate(std::unique_ptr<MediaDelegate> delegate);
222 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); 226 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate);
223 void DeleteSystemTrayDelegate(); 227 void DeleteSystemTrayDelegate();
224 228
225 void DeleteWindowSelectorController(); 229 void DeleteWindowSelectorController();
226 230
227 void CreateMaximizeModeController(); 231 void CreateMaximizeModeController();
228 void DeleteMaximizeModeController(); 232 void DeleteMaximizeModeController();
229 233
230 void CreateMruWindowTracker(); 234 void CreateMruWindowTracker();
231 void DeleteMruWindowTracker(); 235 void DeleteMruWindowTracker();
232 236
233 private: 237 private:
234 friend class Shell; 238 friend class Shell;
235 239
236 static WmShell* instance_; 240 static WmShell* instance_;
237 241
238 base::ObserverList<ShellObserver> shell_observers_; 242 base::ObserverList<ShellObserver> shell_observers_;
239 243 std::unique_ptr<ShellDelegate> delegate_;
240 std::unique_ptr<FocusCycler> focus_cycler_; 244 std::unique_ptr<FocusCycler> focus_cycler_;
241 std::unique_ptr<KeyboardUI> keyboard_ui_; 245 std::unique_ptr<KeyboardUI> keyboard_ui_;
242 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; 246 std::unique_ptr<MaximizeModeController> maximize_mode_controller_;
243 std::unique_ptr<MediaDelegate> media_delegate_; 247 std::unique_ptr<MediaDelegate> media_delegate_;
244 std::unique_ptr<MruWindowTracker> mru_window_tracker_; 248 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
245 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; 249 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
246 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; 250 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
247 std::unique_ptr<WindowSelectorController> window_selector_controller_; 251 std::unique_ptr<WindowSelectorController> window_selector_controller_;
248 252
249 bool simulate_modal_window_open_for_testing_ = false; 253 bool simulate_modal_window_open_for_testing_ = false;
250 254
251 #if defined(OS_CHROMEOS) 255 #if defined(OS_CHROMEOS)
252 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; 256 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
253 #endif 257 #endif
254 }; 258 };
255 259
256 } // namespace ash 260 } // namespace ash
257 261
258 #endif // ASH_COMMON_WM_SHELL_H_ 262 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/shell_delegate.h ('k') | ash/common/wm_shell.cc » ('j') | ash/mus/window_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698