| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 class RootWindowController; | 69 class RootWindowController; |
| 70 class ScopedDisableInternalMouseAndKeyboard; | 70 class ScopedDisableInternalMouseAndKeyboard; |
| 71 class SessionController; | 71 class SessionController; |
| 72 class SessionStateDelegate; | 72 class SessionStateDelegate; |
| 73 class ShelfController; | 73 class ShelfController; |
| 74 class ShelfDelegate; | 74 class ShelfDelegate; |
| 75 class ShelfModel; | 75 class ShelfModel; |
| 76 class ShelfWindowWatcher; | 76 class ShelfWindowWatcher; |
| 77 class ShellDelegate; | 77 class ShellDelegate; |
| 78 struct ShellInitParams; | 78 struct ShellInitParams; |
| 79 class ShellObserver; | |
| 80 class ShutdownController; | 79 class ShutdownController; |
| 81 class SystemTrayDelegate; | 80 class SystemTrayDelegate; |
| 82 class SystemTrayController; | 81 class SystemTrayController; |
| 83 class SystemTrayNotifier; | 82 class SystemTrayNotifier; |
| 84 class ToastManager; | 83 class ToastManager; |
| 85 class VpnList; | 84 class VpnList; |
| 86 class WallpaperController; | 85 class WallpaperController; |
| 87 class WallpaperDelegate; | 86 class WallpaperDelegate; |
| 88 class WindowCycleController; | 87 class WindowCycleController; |
| 89 class WindowCycleEventFilter; | 88 class WindowCycleEventFilter; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 CreateImmersiveFullscreenController() = 0; | 343 CreateImmersiveFullscreenController() = 0; |
| 345 | 344 |
| 346 virtual std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() = 0; | 345 virtual std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() = 0; |
| 347 | 346 |
| 348 // Creates the ShelfView for each display and populates it with items. | 347 // Creates the ShelfView for each display and populates it with items. |
| 349 // Called after the user session is active and profile is available. | 348 // Called after the user session is active and profile is available. |
| 350 void CreateShelfView(); | 349 void CreateShelfView(); |
| 351 | 350 |
| 352 void CreateShelfDelegate(); | 351 void CreateShelfDelegate(); |
| 353 | 352 |
| 354 // Called after maximize mode has started, windows might still animate though. | |
| 355 void OnMaximizeModeStarted(); | |
| 356 | |
| 357 // Called after maximize mode is about to end. | |
| 358 void OnMaximizeModeEnding(); | |
| 359 | |
| 360 // Called after maximize mode has ended, windows might still be returning to | |
| 361 // their original position. | |
| 362 void OnMaximizeModeEnded(); | |
| 363 | |
| 364 // Called when the overview mode is about to be started (before the windows | |
| 365 // get re-arranged). | |
| 366 virtual void OnOverviewModeStarting() = 0; | |
| 367 | |
| 368 // Called after overview mode has ended. | |
| 369 virtual void OnOverviewModeEnded() = 0; | |
| 370 | |
| 371 // Called when the login status changes. | 353 // Called when the login status changes. |
| 372 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. | 354 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
| 373 void UpdateAfterLoginStatusChange(LoginStatus status); | 355 void UpdateAfterLoginStatusChange(LoginStatus status); |
| 374 | 356 |
| 375 // Notify observers that fullscreen mode has changed for |root_window|. | |
| 376 void NotifyFullscreenStateChanged(bool is_fullscreen, WmWindow* root_window); | |
| 377 | |
| 378 // Notify observers that |pinned_window| changed its pinned window state. | |
| 379 void NotifyPinnedStateChanged(WmWindow* pinned_window); | |
| 380 | |
| 381 // Notify observers that the virtual keyboard has been activated/deactivated. | |
| 382 void NotifyVirtualKeyboardActivated(bool activated); | |
| 383 | |
| 384 // Notify observers that the shelf was created for |root_window|. | |
| 385 // TODO(jamescook): Move to Shelf. | |
| 386 void NotifyShelfCreatedForRootWindow(WmWindow* root_window); | |
| 387 | |
| 388 // Notify observers that |root_window|'s shelf changed auto-hide alignment. | |
| 389 // TODO(jamescook): Move to Shelf. | |
| 390 void NotifyShelfAlignmentChanged(WmWindow* root_window); | |
| 391 | |
| 392 // Notify observers that |root_window|'s shelf changed auto-hide behavior. | |
| 393 // TODO(jamescook): Move to Shelf. | |
| 394 void NotifyShelfAutoHideBehaviorChanged(WmWindow* root_window); | |
| 395 | |
| 396 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; | 357 virtual SessionStateDelegate* GetSessionStateDelegate() = 0; |
| 397 | 358 |
| 398 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; | 359 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; |
| 399 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; | 360 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; |
| 400 | 361 |
| 401 void AddShellObserver(ShellObserver* observer); | |
| 402 void RemoveShellObserver(ShellObserver* observer); | |
| 403 | |
| 404 // If |events| is PointerWatcherEventTypes::MOVES, | 362 // If |events| is PointerWatcherEventTypes::MOVES, |
| 405 // PointerWatcher::OnPointerEventObserved() is called for pointer move events. | 363 // PointerWatcher::OnPointerEventObserved() is called for pointer move events. |
| 406 // If |events| is PointerWatcherEventTypes::DRAGS, | 364 // If |events| is PointerWatcherEventTypes::DRAGS, |
| 407 // PointerWatcher::OnPointerEventObserved() is called for pointer drag events. | 365 // PointerWatcher::OnPointerEventObserved() is called for pointer drag events. |
| 408 // Requesting pointer moves or drags may incur a performance hit and should be | 366 // Requesting pointer moves or drags may incur a performance hit and should be |
| 409 // avoided if possible. | 367 // avoided if possible. |
| 410 virtual void AddPointerWatcher(views::PointerWatcher* watcher, | 368 virtual void AddPointerWatcher(views::PointerWatcher* watcher, |
| 411 views::PointerWatcherEventTypes events) = 0; | 369 views::PointerWatcherEventTypes events) = 0; |
| 412 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; | 370 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; |
| 413 | 371 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 435 virtual void CreatePointerWatcherAdapter() = 0; | 393 virtual void CreatePointerWatcherAdapter() = 0; |
| 436 | 394 |
| 437 protected: | 395 protected: |
| 438 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); | 396 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); |
| 439 | 397 |
| 440 // Called during startup to create the primary WindowTreeHost and | 398 // Called during startup to create the primary WindowTreeHost and |
| 441 // the corresponding RootWindowController. | 399 // the corresponding RootWindowController. |
| 442 virtual void CreatePrimaryHost() = 0; | 400 virtual void CreatePrimaryHost() = 0; |
| 443 virtual void InitHosts(const ShellInitParams& init_params) = 0; | 401 virtual void InitHosts(const ShellInitParams& init_params) = 0; |
| 444 | 402 |
| 445 base::ObserverList<ShellObserver>* shell_observers() { | |
| 446 return &shell_observers_; | |
| 447 } | |
| 448 | |
| 449 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); | 403 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); |
| 450 | 404 |
| 451 // Helpers to set (and initialize) or destroy various delegates. | 405 // Helpers to set (and initialize) or destroy various delegates. |
| 452 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. | 406 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. |
| 453 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 407 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
| 454 void DeleteSystemTrayDelegate(); | 408 void DeleteSystemTrayDelegate(); |
| 455 | 409 |
| 456 void DeleteWindowCycleController(); | 410 void DeleteWindowCycleController(); |
| 457 | 411 |
| 458 void DeleteWindowSelectorController(); | 412 void DeleteWindowSelectorController(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 471 // SessionStateObserver: | 425 // SessionStateObserver: |
| 472 void SessionStateChanged(session_manager::SessionState state) override; | 426 void SessionStateChanged(session_manager::SessionState state) override; |
| 473 | 427 |
| 474 private: | 428 private: |
| 475 friend class AcceleratorControllerTest; | 429 friend class AcceleratorControllerTest; |
| 476 friend class Shell; | 430 friend class Shell; |
| 477 friend class WmShellTestApi; | 431 friend class WmShellTestApi; |
| 478 | 432 |
| 479 static WmShell* instance_; | 433 static WmShell* instance_; |
| 480 | 434 |
| 481 base::ObserverList<ShellObserver> shell_observers_; | |
| 482 std::unique_ptr<ShellDelegate> delegate_; | 435 std::unique_ptr<ShellDelegate> delegate_; |
| 483 | 436 |
| 484 scoped_refptr<preferences::PrefClientStore> pref_store_; | 437 scoped_refptr<preferences::PrefClientStore> pref_store_; |
| 485 | 438 |
| 486 std::unique_ptr<AcceleratorController> accelerator_controller_; | 439 std::unique_ptr<AcceleratorController> accelerator_controller_; |
| 487 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; | 440 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; |
| 488 std::unique_ptr<app_list::AppList> app_list_; | 441 std::unique_ptr<app_list::AppList> app_list_; |
| 489 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; | 442 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; |
| 490 std::unique_ptr<CastConfigController> cast_config_; | 443 std::unique_ptr<CastConfigController> cast_config_; |
| 491 std::unique_ptr<FocusCycler> focus_cycler_; | 444 std::unique_ptr<FocusCycler> focus_cycler_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 519 base::ObserverList<LockStateObserver> lock_state_observers_; | 472 base::ObserverList<LockStateObserver> lock_state_observers_; |
| 520 | 473 |
| 521 bool simulate_modal_window_open_for_testing_ = false; | 474 bool simulate_modal_window_open_for_testing_ = false; |
| 522 | 475 |
| 523 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 476 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
| 524 }; | 477 }; |
| 525 | 478 |
| 526 } // namespace ash | 479 } // namespace ash |
| 527 | 480 |
| 528 #endif // ASH_COMMON_WM_SHELL_H_ | 481 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |