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

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

Issue 2154523002: Move AccessibilityDelegate ownership to ash::WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setmediadelegate
Patch Set: fix mash_unittests 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/wm/overview/window_selector.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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Similar to ash::Shell. Eventually the two will be merged. 53 // Similar to ash::Shell. Eventually the two will be merged.
54 class ASH_EXPORT WmShell { 54 class ASH_EXPORT WmShell {
55 public: 55 public:
56 // This is necessary for a handful of places that is difficult to plumb 56 // This is necessary for a handful of places that is difficult to plumb
57 // through context. 57 // through context.
58 static void Set(WmShell* instance); 58 static void Set(WmShell* instance);
59 static WmShell* Get(); 59 static WmShell* Get();
60 static bool HasInstance() { return instance_ != nullptr; } 60 static bool HasInstance() { return instance_ != nullptr; }
61 61
62 void Initialize(); 62 void Initialize();
63 virtual void Shutdown();
63 64
64 ShellDelegate* delegate() { return delegate_.get(); } 65 ShellDelegate* delegate() { return delegate_.get(); }
65 66
67 AccessibilityDelegate* accessibility_delegate() {
68 return accessibility_delegate_.get();
69 }
70
66 BrightnessControlDelegate* brightness_control_delegate() { 71 BrightnessControlDelegate* brightness_control_delegate() {
67 return brightness_control_delegate_.get(); 72 return brightness_control_delegate_.get();
68 } 73 }
69 74
70 FocusCycler* focus_cycler() { return focus_cycler_.get(); } 75 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
71 76
72 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { 77 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
73 return keyboard_brightness_control_delegate_.get(); 78 return keyboard_brightness_control_delegate_.get();
74 } 79 }
75 80
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 virtual void OnOverviewModeEnded() = 0; 192 virtual void OnOverviewModeEnded() = 0;
188 193
189 // Notifies |observers_| when entering or exiting pinned mode for 194 // Notifies |observers_| when entering or exiting pinned mode for
190 // |pinned_window|. Entering or exiting can be checked by looking at 195 // |pinned_window|. Entering or exiting can be checked by looking at
191 // |pinned_window|'s window state. 196 // |pinned_window|'s window state.
192 void NotifyPinnedStateChanged(WmWindow* pinned_window); 197 void NotifyPinnedStateChanged(WmWindow* pinned_window);
193 198
194 // Called when virtual keyboard has been activated/deactivated. 199 // Called when virtual keyboard has been activated/deactivated.
195 void OnVirtualKeyboardActivated(bool activated); 200 void OnVirtualKeyboardActivated(bool activated);
196 201
197 virtual AccessibilityDelegate* GetAccessibilityDelegate() = 0;
198
199 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; 202 virtual SessionStateDelegate* GetSessionStateDelegate() = 0;
200 203
201 virtual void AddActivationObserver(WmActivationObserver* observer) = 0; 204 virtual void AddActivationObserver(WmActivationObserver* observer) = 0;
202 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0; 205 virtual void RemoveActivationObserver(WmActivationObserver* observer) = 0;
203 206
204 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; 207 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0;
205 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; 208 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0;
206 209
207 void AddShellObserver(ShellObserver* observer); 210 void AddShellObserver(ShellObserver* observer);
208 void RemoveShellObserver(ShellObserver* observer); 211 void RemoveShellObserver(ShellObserver* observer);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 247
245 private: 248 private:
246 friend class AcceleratorControllerTest; 249 friend class AcceleratorControllerTest;
247 friend class Shell; 250 friend class Shell;
248 251
249 static WmShell* instance_; 252 static WmShell* instance_;
250 253
251 base::ObserverList<ShellObserver> shell_observers_; 254 base::ObserverList<ShellObserver> shell_observers_;
252 std::unique_ptr<ShellDelegate> delegate_; 255 std::unique_ptr<ShellDelegate> delegate_;
253 256
257 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
254 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; 258 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
255 std::unique_ptr<FocusCycler> focus_cycler_; 259 std::unique_ptr<FocusCycler> focus_cycler_;
256 std::unique_ptr<KeyboardBrightnessControlDelegate> 260 std::unique_ptr<KeyboardBrightnessControlDelegate>
257 keyboard_brightness_control_delegate_; 261 keyboard_brightness_control_delegate_;
258 std::unique_ptr<KeyboardUI> keyboard_ui_; 262 std::unique_ptr<KeyboardUI> keyboard_ui_;
259 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; 263 std::unique_ptr<MaximizeModeController> maximize_mode_controller_;
260 std::unique_ptr<MediaDelegate> media_delegate_; 264 std::unique_ptr<MediaDelegate> media_delegate_;
261 std::unique_ptr<MruWindowTracker> mru_window_tracker_; 265 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
262 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; 266 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
263 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; 267 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
264 std::unique_ptr<WindowSelectorController> window_selector_controller_; 268 std::unique_ptr<WindowSelectorController> window_selector_controller_;
265 269
266 bool simulate_modal_window_open_for_testing_ = false; 270 bool simulate_modal_window_open_for_testing_ = false;
267 271
268 #if defined(OS_CHROMEOS) 272 #if defined(OS_CHROMEOS)
269 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; 273 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
270 #endif 274 #endif
271 }; 275 };
272 276
273 } // namespace ash 277 } // namespace ash
274 278
275 #endif // ASH_COMMON_WM_SHELL_H_ 279 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_selector.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698