OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 set_media_delegate(std::unique_ptr<MediaDelegate> delegate) { | |
James Cook
2016/06/30 21:19:54
nit: I would do SetMediaDelegate() and put this in
msw
2016/06/30 21:28:18
Done.
| |
192 media_delegate_ = std::move(delegate); | |
193 } | |
187 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 194 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
188 void DeleteSystemTrayDelegate(); | 195 void DeleteSystemTrayDelegate(); |
189 | 196 |
190 void DeleteWindowSelectorController(); | 197 void DeleteWindowSelectorController(); |
191 | 198 |
192 private: | 199 private: |
193 friend class Shell; | 200 friend class Shell; |
194 | 201 |
195 static WmShell* instance_; | 202 static WmShell* instance_; |
196 | 203 |
197 std::unique_ptr<FocusCycler> focus_cycler_; | 204 std::unique_ptr<FocusCycler> focus_cycler_; |
198 std::unique_ptr<KeyboardUI> keyboard_ui_; | 205 std::unique_ptr<KeyboardUI> keyboard_ui_; |
206 std::unique_ptr<MediaDelegate> media_delegate_; | |
James Cook
2016/06/30 21:19:54
hooray for keeping them alphabetized!
msw
2016/06/30 21:28:18
Acknowledged.
| |
199 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; | 207 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
200 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 208 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
201 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 209 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
202 | 210 |
203 bool simulate_modal_window_open_for_testing_ = false; | 211 bool simulate_modal_window_open_for_testing_ = false; |
204 | 212 |
205 #if defined(OS_CHROMEOS) | 213 #if defined(OS_CHROMEOS) |
206 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; | 214 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
207 #endif | 215 #endif |
208 }; | 216 }; |
209 | 217 |
210 } // namespace ash | 218 } // namespace ash |
211 | 219 |
212 #endif // ASH_COMMON_WM_SHELL_H_ | 220 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |