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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Initializes the appropriate shelves. Does nothing for any existing shelves. | 356 // Initializes the appropriate shelves. Does nothing for any existing shelves. |
358 void CreateShelf(); | 357 void CreateShelf(); |
359 | 358 |
| 359 // Show shelf view if it was created hidden (before session has started). |
| 360 void ShowShelf(); |
| 361 |
360 void CreateShelfDelegate(); | 362 void CreateShelfDelegate(); |
361 | 363 |
362 // Called after maximize mode has started, windows might still animate though. | 364 // Called after maximize mode has started, windows might still animate though. |
363 void OnMaximizeModeStarted(); | 365 void OnMaximizeModeStarted(); |
364 | 366 |
365 // 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 |
366 // their original position. | 368 // their original position. |
367 void OnMaximizeModeEnded(); | 369 void OnMaximizeModeEnded(); |
368 | 370 |
369 // 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... |
438 virtual bool IsTouchDown() = 0; | 440 virtual bool IsTouchDown() = 0; |
439 | 441 |
440 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. | 442 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. |
441 virtual void ToggleIgnoreExternalKeyboard() = 0; | 443 virtual void ToggleIgnoreExternalKeyboard() = 0; |
442 | 444 |
443 // Enable or disable the laser pointer. | 445 // Enable or disable the laser pointer. |
444 virtual void SetLaserPointerEnabled(bool enabled) = 0; | 446 virtual void SetLaserPointerEnabled(bool enabled) = 0; |
445 | 447 |
446 protected: | 448 protected: |
447 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); | 449 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); |
448 ~WmShell() override; | 450 virtual ~WmShell(); |
449 | 451 |
450 base::ObserverList<ShellObserver>* shell_observers() { | 452 base::ObserverList<ShellObserver>* shell_observers() { |
451 return &shell_observers_; | 453 return &shell_observers_; |
452 } | 454 } |
453 | 455 |
454 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); | 456 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); |
455 | 457 |
456 // Helpers to set (and initialize) or destroy various delegates. | 458 // Helpers to set (and initialize) or destroy various delegates. |
457 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. | 459 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. |
458 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 460 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
459 void DeleteSystemTrayDelegate(); | 461 void DeleteSystemTrayDelegate(); |
460 | 462 |
461 void DeleteWindowCycleController(); | 463 void DeleteWindowCycleController(); |
462 | 464 |
463 void DeleteWindowSelectorController(); | 465 void DeleteWindowSelectorController(); |
464 | 466 |
465 void CreateMaximizeModeController(); | 467 void CreateMaximizeModeController(); |
466 void DeleteMaximizeModeController(); | 468 void DeleteMaximizeModeController(); |
467 | 469 |
468 void CreateMruWindowTracker(); | 470 void CreateMruWindowTracker(); |
469 void DeleteMruWindowTracker(); | 471 void DeleteMruWindowTracker(); |
470 | 472 |
471 void DeleteToastManager(); | 473 void DeleteToastManager(); |
472 | 474 |
473 void SetAcceleratorController( | 475 void SetAcceleratorController( |
474 std::unique_ptr<AcceleratorController> accelerator_controller); | 476 std::unique_ptr<AcceleratorController> accelerator_controller); |
475 | 477 |
476 // SessionStateObserver: | |
477 void SessionStateChanged(session_manager::SessionState state) override; | |
478 | |
479 private: | 478 private: |
480 friend class AcceleratorControllerTest; | 479 friend class AcceleratorControllerTest; |
481 friend class ScopedRootWindowForNewWindows; | 480 friend class ScopedRootWindowForNewWindows; |
482 friend class Shell; | 481 friend class Shell; |
483 friend class WmShellTestApi; | 482 friend class WmShellTestApi; |
484 | 483 |
485 static WmShell* instance_; | 484 static WmShell* instance_; |
486 | 485 |
487 base::ObserverList<ShellObserver> shell_observers_; | 486 base::ObserverList<ShellObserver> shell_observers_; |
488 std::unique_ptr<ShellDelegate> delegate_; | 487 std::unique_ptr<ShellDelegate> delegate_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 WmWindow* scoped_root_window_for_new_windows_ = nullptr; | 528 WmWindow* scoped_root_window_for_new_windows_ = nullptr; |
530 | 529 |
531 bool simulate_modal_window_open_for_testing_ = false; | 530 bool simulate_modal_window_open_for_testing_ = false; |
532 | 531 |
533 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 532 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
534 }; | 533 }; |
535 | 534 |
536 } // namespace ash | 535 } // namespace ash |
537 | 536 |
538 #endif // ASH_COMMON_WM_SHELL_H_ | 537 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |