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