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

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

Issue 2752593008: Move AcceleratorController from WmShell to Shell (Closed)
Patch Set: cleanup 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/system/tray/system_tray_unittest.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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Similar to ash::Shell. Eventually the two will be merged. 85 // Similar to ash::Shell. Eventually the two will be merged.
86 class ASH_EXPORT WmShell : public SessionStateObserver { 86 class ASH_EXPORT WmShell : public SessionStateObserver {
87 public: 87 public:
88 ~WmShell() override; 88 ~WmShell() override;
89 89
90 static WmShell* Get(); 90 static WmShell* Get();
91 static bool HasInstance() { return instance_ != nullptr; } 91 static bool HasInstance() { return instance_ != nullptr; }
92 92
93 virtual void Shutdown(); 93 virtual void Shutdown();
94 94
95 AcceleratorController* accelerator_controller() {
96 return accelerator_controller_.get();
97 }
98
99 BrightnessControlDelegate* brightness_control_delegate() { 95 BrightnessControlDelegate* brightness_control_delegate() {
100 return brightness_control_delegate_.get(); 96 return brightness_control_delegate_.get();
101 } 97 }
102 98
103 CastConfigController* cast_config() { return cast_config_.get(); } 99 CastConfigController* cast_config() { return cast_config_.get(); }
104 100
105 FocusCycler* focus_cycler() { return focus_cycler_.get(); } 101 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
106 102
107 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { 103 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
108 return keyboard_brightness_control_delegate_.get(); 104 return keyboard_brightness_control_delegate_.get();
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 virtual void CreatePointerWatcherAdapter() = 0; 322 virtual void CreatePointerWatcherAdapter() = 0;
327 323
328 protected: 324 protected:
329 WmShell(); 325 WmShell();
330 326
331 // Called during startup to create the primary WindowTreeHost and 327 // Called during startup to create the primary WindowTreeHost and
332 // the corresponding RootWindowController. 328 // the corresponding RootWindowController.
333 virtual void CreatePrimaryHost() = 0; 329 virtual void CreatePrimaryHost() = 0;
334 virtual void InitHosts(const ShellInitParams& init_params) = 0; 330 virtual void InitHosts(const ShellInitParams& init_params) = 0;
335 331
332 // Called during startup to create the AcceleratorController.
James Cook 2017/03/17 18:01:46 Thanks for documenting when it is expected to be c
333 virtual std::unique_ptr<AcceleratorController>
334 CreateAcceleratorController() = 0;
335
336 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); 336 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui);
337 337
338 // Helpers to set (and initialize) or destroy various delegates. 338 // Helpers to set (and initialize) or destroy various delegates.
339 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. 339 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported.
340 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); 340 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate);
341 void DeleteSystemTrayDelegate(); 341 void DeleteSystemTrayDelegate();
342 342
343 void DeleteWindowCycleController(); 343 void DeleteWindowCycleController();
344 344
345 void DeleteWindowSelectorController(); 345 void DeleteWindowSelectorController();
346 346
347 void CreateMaximizeModeController(); 347 void CreateMaximizeModeController();
348 void DeleteMaximizeModeController(); 348 void DeleteMaximizeModeController();
349 349
350 void CreateMruWindowTracker(); 350 void CreateMruWindowTracker();
351 void DeleteMruWindowTracker(); 351 void DeleteMruWindowTracker();
352 352
353 void SetAcceleratorController(
354 std::unique_ptr<AcceleratorController> accelerator_controller);
355
356 // SessionStateObserver: 353 // SessionStateObserver:
357 void SessionStateChanged(session_manager::SessionState state) override; 354 void SessionStateChanged(session_manager::SessionState state) override;
358 355
359 private: 356 private:
360 friend class AcceleratorControllerTest; 357 friend class AcceleratorControllerTest;
361 friend class Shell; 358 friend class Shell;
362 friend class WmShellTestApi; 359 friend class WmShellTestApi;
363 360
364 static WmShell* instance_; 361 static WmShell* instance_;
365 362
366 std::unique_ptr<AcceleratorController> accelerator_controller_;
367 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; 363 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
368 std::unique_ptr<CastConfigController> cast_config_; 364 std::unique_ptr<CastConfigController> cast_config_;
369 std::unique_ptr<FocusCycler> focus_cycler_; 365 std::unique_ptr<FocusCycler> focus_cycler_;
370 std::unique_ptr<ImmersiveContextAsh> immersive_context_; 366 std::unique_ptr<ImmersiveContextAsh> immersive_context_;
371 std::unique_ptr<KeyboardBrightnessControlDelegate> 367 std::unique_ptr<KeyboardBrightnessControlDelegate>
372 keyboard_brightness_control_delegate_; 368 keyboard_brightness_control_delegate_;
373 std::unique_ptr<KeyboardUI> keyboard_ui_; 369 std::unique_ptr<KeyboardUI> keyboard_ui_;
374 std::unique_ptr<LocaleNotificationController> locale_notification_controller_; 370 std::unique_ptr<LocaleNotificationController> locale_notification_controller_;
375 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; 371 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
376 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; 372 std::unique_ptr<MaximizeModeController> maximize_mode_controller_;
(...skipping 13 matching lines...) Expand all
390 std::unique_ptr<WindowSelectorController> window_selector_controller_; 386 std::unique_ptr<WindowSelectorController> window_selector_controller_;
391 387
392 base::ObserverList<LockStateObserver> lock_state_observers_; 388 base::ObserverList<LockStateObserver> lock_state_observers_;
393 389
394 bool simulate_modal_window_open_for_testing_ = false; 390 bool simulate_modal_window_open_for_testing_ = false;
395 }; 391 };
396 392
397 } // namespace ash 393 } // namespace ash
398 394
399 #endif // ASH_COMMON_WM_SHELL_H_ 395 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray_unittest.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698