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> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 class RootWindowController; | 70 class RootWindowController; |
71 class ScopedDisableInternalMouseAndKeyboard; | 71 class ScopedDisableInternalMouseAndKeyboard; |
72 class SessionController; | 72 class SessionController; |
73 class SessionStateDelegate; | 73 class SessionStateDelegate; |
74 class ShelfController; | 74 class ShelfController; |
75 class ShelfDelegate; | 75 class ShelfDelegate; |
76 class ShelfModel; | 76 class ShelfModel; |
77 class ShelfWindowWatcher; | 77 class ShelfWindowWatcher; |
78 class ShellDelegate; | 78 class ShellDelegate; |
79 struct ShellInitParams; | 79 struct ShellInitParams; |
80 class ShellObserver; | |
81 class ShutdownController; | 80 class ShutdownController; |
82 class SystemTrayDelegate; | 81 class SystemTrayDelegate; |
83 class SystemTrayController; | 82 class SystemTrayController; |
84 class SystemTrayNotifier; | 83 class SystemTrayNotifier; |
85 class ToastManager; | 84 class ToastManager; |
86 class VpnList; | 85 class VpnList; |
87 class WallpaperController; | 86 class WallpaperController; |
88 class WallpaperDelegate; | 87 class WallpaperDelegate; |
89 class WindowCycleController; | 88 class WindowCycleController; |
90 class WindowCycleEventFilter; | 89 class WindowCycleEventFilter; |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 CreateImmersiveFullscreenController() = 0; | 356 CreateImmersiveFullscreenController() = 0; |
358 | 357 |
359 virtual std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() = 0; | 358 virtual std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() = 0; |
360 | 359 |
361 // Creates the ShelfView for each display and populates it with items. | 360 // Creates the ShelfView for each display and populates it with items. |
362 // Called after the user session is active and profile is available. | 361 // Called after the user session is active and profile is available. |
363 void CreateShelfView(); | 362 void CreateShelfView(); |
364 | 363 |
365 void CreateShelfDelegate(); | 364 void CreateShelfDelegate(); |
366 | 365 |
367 // Called after maximize mode has started, windows might still animate though. | |
368 void OnMaximizeModeStarted(); | |
369 | |
370 // Called after maximize mode is about to end. | |
371 void OnMaximizeModeEnding(); | |
372 | |
373 // Called after maximize mode has ended, windows might still be returning to | |
374 // their original position. | |
375 void OnMaximizeModeEnded(); | |
376 | |
377 // Called when the overview mode is about to be started (before the windows | |
378 // get re-arranged). | |
379 virtual void OnOverviewModeStarting() = 0; | |
380 | |
381 // Called after overview mode has ended. | |
382 virtual void OnOverviewModeEnded() = 0; | |
383 | |
384 // Called when the login status changes. | 366 // Called when the login status changes. |
385 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. | 367 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
386 void UpdateAfterLoginStatusChange(LoginStatus status); | 368 void UpdateAfterLoginStatusChange(LoginStatus status); |
387 | 369 |
388 // Notify observers that fullscreen mode has changed for |root_window|. | |
389 void NotifyFullscreenStateChanged(bool is_fullscreen, WmWindow* root_window); | |
390 | |
391 // Notify observers that |pinned_window| changed its pinned window state. | |
392 void NotifyPinnedStateChanged(WmWindow* pinned_window); | |
393 | |
394 // Notify observers that the virtual keyboard has been activated/deactivated. | |
395 void NotifyVirtualKeyboardActivated(bool activated); | |
396 | |
397 // Notify observers that the shelf was created for |root_window|. | |
398 // TODO(jamescook): Move to Shelf. | |
399 void NotifyShelfCreatedForRootWindow(WmWindow* root_window); | |
400 | |
401 // Notify observers that |root_window|'s shelf changed auto-hide alignment. | |
402 // TODO(jamescook): Move to Shelf. | |
403 void NotifyShelfAlignmentChanged(WmWindow* root_window); | |
404 | |
405 // Notify observers that |root_window|'s shelf changed auto-hide behavior. | |
406 // TODO(jamescook): Move to Shelf. | |
407 void NotifyShelfAutoHideBehaviorChanged(WmWindow* root_window); | |
408 | |
409 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; | 370 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; |
410 | 371 |
411 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; | 372 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; |
412 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; | 373 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; |
413 | 374 |
414 void AddShellObserver(ShellObserver* observer); | |
415 void RemoveShellObserver(ShellObserver* observer); | |
416 | |
417 // If |events| is PointerWatcherEventTypes::MOVES, | 375 // If |events| is PointerWatcherEventTypes::MOVES, |
418 // PointerWatcher::OnPointerEventObserved() is called for pointer move events. | 376 // PointerWatcher::OnPointerEventObserved() is called for pointer move events. |
419 // If |events| is PointerWatcherEventTypes::DRAGS, | 377 // If |events| is PointerWatcherEventTypes::DRAGS, |
420 // PointerWatcher::OnPointerEventObserved() is called for pointer drag events. | 378 // PointerWatcher::OnPointerEventObserved() is called for pointer drag events. |
421 // Requesting pointer moves or drags may incur a performance hit and should be | 379 // Requesting pointer moves or drags may incur a performance hit and should be |
422 // avoided if possible. | 380 // avoided if possible. |
423 virtual void AddPointerWatcher(views::PointerWatcher* watcher, | 381 virtual void AddPointerWatcher(views::PointerWatcher* watcher, |
424 views::PointerWatcherEventTypes events) = 0; | 382 views::PointerWatcherEventTypes events) = 0; |
425 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; | 383 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; |
426 | 384 |
(...skipping 21 matching lines...) Expand all Loading... |
448 virtual void CreatePointerWatcherAdapter() = 0; | 406 virtual void CreatePointerWatcherAdapter() = 0; |
449 | 407 |
450 protected: | 408 protected: |
451 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); | 409 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); |
452 | 410 |
453 // Called during startup to create the primary WindowTreeHost and | 411 // Called during startup to create the primary WindowTreeHost and |
454 // the corresponding RootWindowController. | 412 // the corresponding RootWindowController. |
455 virtual void CreatePrimaryHost() = 0; | 413 virtual void CreatePrimaryHost() = 0; |
456 virtual void InitHosts(const ShellInitParams& init_params) = 0; | 414 virtual void InitHosts(const ShellInitParams& init_params) = 0; |
457 | 415 |
458 base::ObserverList<ShellObserver>* shell_observers() { | |
459 return &shell_observers_; | |
460 } | |
461 | |
462 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); | 416 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); |
463 | 417 |
464 // Helpers to set (and initialize) or destroy various delegates. | 418 // Helpers to set (and initialize) or destroy various delegates. |
465 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. | 419 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. |
466 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 420 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
467 void DeleteSystemTrayDelegate(); | 421 void DeleteSystemTrayDelegate(); |
468 | 422 |
469 void DeleteWindowCycleController(); | 423 void DeleteWindowCycleController(); |
470 | 424 |
471 void DeleteWindowSelectorController(); | 425 void DeleteWindowSelectorController(); |
(...skipping 18 matching lines...) Expand all Loading... |
490 friend class Shell; | 444 friend class Shell; |
491 friend class WmShellTestApi; | 445 friend class WmShellTestApi; |
492 | 446 |
493 // aura::client::ActivationChangeObserver: | 447 // aura::client::ActivationChangeObserver: |
494 void OnWindowActivated(ActivationReason reason, | 448 void OnWindowActivated(ActivationReason reason, |
495 aura::Window* gained_active, | 449 aura::Window* gained_active, |
496 aura::Window* lost_active) override; | 450 aura::Window* lost_active) override; |
497 | 451 |
498 static WmShell* instance_; | 452 static WmShell* instance_; |
499 | 453 |
500 base::ObserverList<ShellObserver> shell_observers_; | |
501 std::unique_ptr<ShellDelegate> delegate_; | 454 std::unique_ptr<ShellDelegate> delegate_; |
502 | 455 |
503 scoped_refptr<preferences::PrefClientStore> pref_store_; | 456 scoped_refptr<preferences::PrefClientStore> pref_store_; |
504 | 457 |
505 std::unique_ptr<AcceleratorController> accelerator_controller_; | 458 std::unique_ptr<AcceleratorController> accelerator_controller_; |
506 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; | 459 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; |
507 std::unique_ptr<app_list::AppList> app_list_; | 460 std::unique_ptr<app_list::AppList> app_list_; |
508 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; | 461 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; |
509 std::unique_ptr<CastConfigController> cast_config_; | 462 std::unique_ptr<CastConfigController> cast_config_; |
510 std::unique_ptr<FocusCycler> focus_cycler_; | 463 std::unique_ptr<FocusCycler> focus_cycler_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 WmWindow* scoped_root_window_for_new_windows_ = nullptr; | 495 WmWindow* scoped_root_window_for_new_windows_ = nullptr; |
543 | 496 |
544 bool simulate_modal_window_open_for_testing_ = false; | 497 bool simulate_modal_window_open_for_testing_ = false; |
545 | 498 |
546 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 499 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
547 }; | 500 }; |
548 | 501 |
549 } // namespace ash | 502 } // namespace ash |
550 | 503 |
551 #endif // ASH_COMMON_WM_SHELL_H_ | 504 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |