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

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

Issue 2113023002: mash: Migrate MediaDelegate ownership and access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment. 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
« no previous file with comments | « ash/common/media_delegate.h ('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>
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/metrics/user_metrics_action.h" 15 #include "ash/common/metrics/user_metrics_action.h"
15 16
16 namespace gfx { 17 namespace gfx {
17 class Rect; 18 class Rect;
18 } 19 }
19 20
20 namespace views { 21 namespace views {
21 class PointerWatcher; 22 class PointerWatcher;
22 } 23 }
23 24
(...skipping 30 matching lines...) Expand all
54 // This is necessary for a handful of places that is difficult to plumb 55 // This is necessary for a handful of places that is difficult to plumb
55 // through context. 56 // through context.
56 static void Set(WmShell* instance); 57 static void Set(WmShell* instance);
57 static WmShell* Get(); 58 static WmShell* Get();
58 static bool HasInstance() { return instance_ != nullptr; } 59 static bool HasInstance() { return instance_ != nullptr; }
59 60
60 FocusCycler* focus_cycler() { return focus_cycler_.get(); } 61 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
61 62
62 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } 63 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
63 64
65 MediaDelegate* media_delegate() { return media_delegate_.get(); }
66
64 SystemTrayNotifier* system_tray_notifier() { 67 SystemTrayNotifier* system_tray_notifier() {
65 return system_tray_notifier_.get(); 68 return system_tray_notifier_.get();
66 } 69 }
67 70
68 SystemTrayDelegate* system_tray_delegate() { 71 SystemTrayDelegate* system_tray_delegate() {
69 return system_tray_delegate_.get(); 72 return system_tray_delegate_.get();
70 } 73 }
71 74
72 WindowSelectorController* window_selector_controller() { 75 WindowSelectorController* window_selector_controller() {
73 return window_selector_controller_.get(); 76 return window_selector_controller_.get();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. 179 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved.
177 virtual void ToggleIgnoreExternalKeyboard() = 0; 180 virtual void ToggleIgnoreExternalKeyboard() = 0;
178 #endif 181 #endif
179 182
180 protected: 183 protected:
181 WmShell(); 184 WmShell();
182 virtual ~WmShell(); 185 virtual ~WmShell();
183 186
184 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); 187 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui);
185 188
186 // Sets and initializes the |delegate|. 189 // Helpers to set (and initialize) or destroy various delegates.
190 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported.
191 void SetMediaDelegate(std::unique_ptr<MediaDelegate> delegate);
187 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); 192 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate);
188 void DeleteSystemTrayDelegate(); 193 void DeleteSystemTrayDelegate();
189 194
190 void DeleteWindowSelectorController(); 195 void DeleteWindowSelectorController();
191 196
192 private: 197 private:
193 friend class Shell; 198 friend class Shell;
194 199
195 static WmShell* instance_; 200 static WmShell* instance_;
196 201
197 std::unique_ptr<FocusCycler> focus_cycler_; 202 std::unique_ptr<FocusCycler> focus_cycler_;
198 std::unique_ptr<KeyboardUI> keyboard_ui_; 203 std::unique_ptr<KeyboardUI> keyboard_ui_;
204 std::unique_ptr<MediaDelegate> media_delegate_;
199 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; 205 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
200 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; 206 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
201 std::unique_ptr<WindowSelectorController> window_selector_controller_; 207 std::unique_ptr<WindowSelectorController> window_selector_controller_;
202 208
203 bool simulate_modal_window_open_for_testing_ = false; 209 bool simulate_modal_window_open_for_testing_ = false;
204 210
205 #if defined(OS_CHROMEOS) 211 #if defined(OS_CHROMEOS)
206 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; 212 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
207 #endif 213 #endif
208 }; 214 };
209 215
210 } // namespace ash 216 } // namespace ash
211 217
212 #endif // ASH_COMMON_WM_SHELL_H_ 218 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/media_delegate.h ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698