| 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/metrics/gesture_action_type.h" | 14 #include "ash/common/metrics/gesture_action_type.h" |
| 15 #include "ash/common/metrics/user_metrics_action.h" | 15 #include "ash/common/metrics/user_metrics_action.h" |
| 16 #include "ash/common/session/session_state_observer.h" | |
| 17 #include "ash/common/wm/lock_state_observer.h" | 16 #include "ash/common/wm/lock_state_observer.h" |
| 18 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 19 #include "components/ui_devtools/devtools_server.h" | 18 #include "components/ui_devtools/devtools_server.h" |
| 20 #include "ui/base/ui_base_types.h" | 19 #include "ui/base/ui_base_types.h" |
| 21 #include "ui/compositor/layer_type.h" | 20 #include "ui/compositor/layer_type.h" |
| 22 #include "ui/wm/public/window_types.h" | 21 #include "ui/wm/public/window_types.h" |
| 23 | 22 |
| 24 namespace app_list { | 23 namespace app_list { |
| 25 class AppList; | 24 class AppList; |
| 26 } | 25 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 94 |
| 96 enum class LoginStatus; | 95 enum class LoginStatus; |
| 97 enum class TaskSwitchSource; | 96 enum class TaskSwitchSource; |
| 98 | 97 |
| 99 namespace wm { | 98 namespace wm { |
| 100 class MaximizeModeEventHandler; | 99 class MaximizeModeEventHandler; |
| 101 class WindowState; | 100 class WindowState; |
| 102 } | 101 } |
| 103 | 102 |
| 104 // Similar to ash::Shell. Eventually the two will be merged. | 103 // Similar to ash::Shell. Eventually the two will be merged. |
| 105 class ASH_EXPORT WmShell : public SessionStateObserver { | 104 class ASH_EXPORT WmShell { |
| 106 public: | 105 public: |
| 107 // This is necessary for a handful of places that is difficult to plumb | 106 // This is necessary for a handful of places that is difficult to plumb |
| 108 // through context. | 107 // through context. |
| 109 static void Set(WmShell* instance); | 108 static void Set(WmShell* instance); |
| 110 static WmShell* Get(); | 109 static WmShell* Get(); |
| 111 static bool HasInstance() { return instance_ != nullptr; } | 110 static bool HasInstance() { return instance_ != nullptr; } |
| 112 | 111 |
| 113 void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool); | 112 void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool); |
| 114 virtual void Shutdown(); | 113 virtual void Shutdown(); |
| 115 | 114 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 WmWindow* workspace_window) = 0; | 346 WmWindow* workspace_window) = 0; |
| 348 | 347 |
| 349 virtual std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> | 348 virtual std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> |
| 350 CreateScopedDisableInternalMouseAndKeyboard() = 0; | 349 CreateScopedDisableInternalMouseAndKeyboard() = 0; |
| 351 | 350 |
| 352 virtual std::unique_ptr<ImmersiveFullscreenController> | 351 virtual std::unique_ptr<ImmersiveFullscreenController> |
| 353 CreateImmersiveFullscreenController() = 0; | 352 CreateImmersiveFullscreenController() = 0; |
| 354 | 353 |
| 355 virtual std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() = 0; | 354 virtual std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() = 0; |
| 356 | 355 |
| 357 // Creates the ShelfView for each display and populates it with items. | 356 // Initializes the appropriate shelves. Does nothing for any existing shelves. |
| 358 // TODO(jamescook): Rename this. http://crbug.com/679925 | |
| 359 void CreateShelf(); | 357 void CreateShelf(); |
| 360 | 358 |
| 359 // Show shelf view if it was created hidden (before session has started). |
| 360 void ShowShelf(); |
| 361 |
| 361 void CreateShelfDelegate(); | 362 void CreateShelfDelegate(); |
| 362 | 363 |
| 363 // Called after maximize mode has started, windows might still animate though. | 364 // Called after maximize mode has started, windows might still animate though. |
| 364 void OnMaximizeModeStarted(); | 365 void OnMaximizeModeStarted(); |
| 365 | 366 |
| 366 // Called after maximize mode has ended, windows might still be returning to | 367 // Called after maximize mode has ended, windows might still be returning to |
| 367 // their original position. | 368 // their original position. |
| 368 void OnMaximizeModeEnded(); | 369 void OnMaximizeModeEnded(); |
| 369 | 370 |
| 370 // Called when the overview mode is about to be started (before the windows | 371 // Called when the overview mode is about to be started (before the windows |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 virtual bool IsTouchDown() = 0; | 440 virtual bool IsTouchDown() = 0; |
| 440 | 441 |
| 441 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. | 442 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. |
| 442 virtual void ToggleIgnoreExternalKeyboard() = 0; | 443 virtual void ToggleIgnoreExternalKeyboard() = 0; |
| 443 | 444 |
| 444 // Enable or disable the laser pointer. | 445 // Enable or disable the laser pointer. |
| 445 virtual void SetLaserPointerEnabled(bool enabled) = 0; | 446 virtual void SetLaserPointerEnabled(bool enabled) = 0; |
| 446 | 447 |
| 447 protected: | 448 protected: |
| 448 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); | 449 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); |
| 449 ~WmShell() override; | 450 virtual ~WmShell(); |
| 450 | 451 |
| 451 base::ObserverList<ShellObserver>* shell_observers() { | 452 base::ObserverList<ShellObserver>* shell_observers() { |
| 452 return &shell_observers_; | 453 return &shell_observers_; |
| 453 } | 454 } |
| 454 | 455 |
| 455 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); | 456 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); |
| 456 | 457 |
| 457 // Helpers to set (and initialize) or destroy various delegates. | 458 // Helpers to set (and initialize) or destroy various delegates. |
| 458 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. | 459 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. |
| 459 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 460 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
| 460 void DeleteSystemTrayDelegate(); | 461 void DeleteSystemTrayDelegate(); |
| 461 | 462 |
| 462 void DeleteWindowCycleController(); | 463 void DeleteWindowCycleController(); |
| 463 | 464 |
| 464 void DeleteWindowSelectorController(); | 465 void DeleteWindowSelectorController(); |
| 465 | 466 |
| 466 void CreateMaximizeModeController(); | 467 void CreateMaximizeModeController(); |
| 467 void DeleteMaximizeModeController(); | 468 void DeleteMaximizeModeController(); |
| 468 | 469 |
| 469 void CreateMruWindowTracker(); | 470 void CreateMruWindowTracker(); |
| 470 void DeleteMruWindowTracker(); | 471 void DeleteMruWindowTracker(); |
| 471 | 472 |
| 472 void DeleteToastManager(); | 473 void DeleteToastManager(); |
| 473 | 474 |
| 474 void SetAcceleratorController( | 475 void SetAcceleratorController( |
| 475 std::unique_ptr<AcceleratorController> accelerator_controller); | 476 std::unique_ptr<AcceleratorController> accelerator_controller); |
| 476 | 477 |
| 477 // SessionStateObserver: | |
| 478 void SessionStateChanged(session_manager::SessionState state) override; | |
| 479 | |
| 480 private: | 478 private: |
| 481 friend class AcceleratorControllerTest; | 479 friend class AcceleratorControllerTest; |
| 482 friend class ScopedRootWindowForNewWindows; | 480 friend class ScopedRootWindowForNewWindows; |
| 483 friend class Shell; | 481 friend class Shell; |
| 484 friend class WmShellTestApi; | 482 friend class WmShellTestApi; |
| 485 | 483 |
| 486 static WmShell* instance_; | 484 static WmShell* instance_; |
| 487 | 485 |
| 488 base::ObserverList<ShellObserver> shell_observers_; | 486 base::ObserverList<ShellObserver> shell_observers_; |
| 489 std::unique_ptr<ShellDelegate> delegate_; | 487 std::unique_ptr<ShellDelegate> delegate_; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 WmWindow* scoped_root_window_for_new_windows_ = nullptr; | 528 WmWindow* scoped_root_window_for_new_windows_ = nullptr; |
| 531 | 529 |
| 532 bool simulate_modal_window_open_for_testing_ = false; | 530 bool simulate_modal_window_open_for_testing_ = false; |
| 533 | 531 |
| 534 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 532 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
| 535 }; | 533 }; |
| 536 | 534 |
| 537 } // namespace ash | 535 } // namespace ash |
| 538 | 536 |
| 539 #endif // ASH_COMMON_WM_SHELL_H_ | 537 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |