| 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_AURA_WM_SHELL_AURA_H_ | 5 #ifndef ASH_AURA_WM_SHELL_AURA_H_ |
| 6 #define ASH_AURA_WM_SHELL_AURA_H_ | 6 #define ASH_AURA_WM_SHELL_AURA_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/aura/wm_lookup_aura.h" | 9 #include "ash/aura/wm_lookup_aura.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| 11 #include "ash/display/window_tree_host_manager.h" | 11 #include "ash/display/window_tree_host_manager.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "ui/wm/public/activation_change_observer.h" | 14 #include "ui/wm/public/activation_change_observer.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 class WmShellCommon; | |
| 19 | |
| 20 class ASH_EXPORT WmShellAura : public WmShell, | 18 class ASH_EXPORT WmShellAura : public WmShell, |
| 21 public aura::client::ActivationChangeObserver, | 19 public aura::client::ActivationChangeObserver, |
| 22 public WindowTreeHostManager::Observer { | 20 public WindowTreeHostManager::Observer { |
| 23 public: | 21 public: |
| 24 // |shell_common| is not owned by this class and must outlive this class. | 22 WmShellAura(); |
| 25 explicit WmShellAura(WmShellCommon* wm_shell_common); | |
| 26 ~WmShellAura() override; | 23 ~WmShellAura() override; |
| 27 | 24 |
| 28 static WmShellAura* Get(); | 25 static WmShellAura* Get(); |
| 29 | 26 |
| 30 // Called early in shutdown sequence. | 27 // Called early in shutdown sequence. |
| 31 void PrepareForShutdown(); | 28 void PrepareForShutdown(); |
| 32 | 29 |
| 33 // WmShell: | 30 // WmShell: |
| 34 MruWindowTracker* GetMruWindowTracker() override; | |
| 35 WmWindow* NewContainerWindow() override; | 31 WmWindow* NewContainerWindow() override; |
| 36 WmWindow* GetFocusedWindow() override; | 32 WmWindow* GetFocusedWindow() override; |
| 37 WmWindow* GetActiveWindow() override; | 33 WmWindow* GetActiveWindow() override; |
| 38 WmWindow* GetPrimaryRootWindow() override; | 34 WmWindow* GetPrimaryRootWindow() override; |
| 39 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; | 35 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; |
| 40 WmWindow* GetRootWindowForNewWindows() override; | 36 WmWindow* GetRootWindowForNewWindows() override; |
| 41 const DisplayInfo& GetDisplayInfo(int64_t display_id) const override; | 37 const DisplayInfo& GetDisplayInfo(int64_t display_id) const override; |
| 42 bool IsForceMaximizeOnFirstRun() override; | 38 bool IsForceMaximizeOnFirstRun() override; |
| 43 bool IsPinned() override; | 39 bool IsPinned() override; |
| 44 void SetPinnedWindow(WmWindow* window) override; | 40 void SetPinnedWindow(WmWindow* window) override; |
| 45 bool CanShowWindowForUser(WmWindow* window) override; | 41 bool CanShowWindowForUser(WmWindow* window) override; |
| 46 void LockCursor() override; | 42 void LockCursor() override; |
| 47 void UnlockCursor() override; | 43 void UnlockCursor() override; |
| 48 std::vector<WmWindow*> GetAllRootWindows() override; | 44 std::vector<WmWindow*> GetAllRootWindows() override; |
| 49 void RecordUserMetricsAction(UserMetricsAction action) override; | 45 void RecordUserMetricsAction(UserMetricsAction action) override; |
| 50 std::unique_ptr<WindowResizer> CreateDragWindowResizer( | 46 std::unique_ptr<WindowResizer> CreateDragWindowResizer( |
| 51 std::unique_ptr<WindowResizer> next_window_resizer, | 47 std::unique_ptr<WindowResizer> next_window_resizer, |
| 52 wm::WindowState* window_state) override; | 48 wm::WindowState* window_state) override; |
| 53 std::unique_ptr<wm::MaximizeModeEventHandler> CreateMaximizeModeEventHandler() | 49 std::unique_ptr<wm::MaximizeModeEventHandler> CreateMaximizeModeEventHandler() |
| 54 override; | 50 override; |
| 55 void OnOverviewModeStarting() override; | 51 void OnOverviewModeStarting() override; |
| 56 void OnOverviewModeEnded() override; | 52 void OnOverviewModeEnded() override; |
| 57 AccessibilityDelegate* GetAccessibilityDelegate() override; | 53 AccessibilityDelegate* GetAccessibilityDelegate() override; |
| 58 SessionStateDelegate* GetSessionStateDelegate() override; | 54 SessionStateDelegate* GetSessionStateDelegate() override; |
| 59 void AddActivationObserver(WmActivationObserver* observer) override; | 55 void AddActivationObserver(WmActivationObserver* observer) override; |
| 60 void RemoveActivationObserver(WmActivationObserver* observer) override; | 56 void RemoveActivationObserver(WmActivationObserver* observer) override; |
| 61 void AddDisplayObserver(WmDisplayObserver* observer) override; | 57 void AddDisplayObserver(WmDisplayObserver* observer) override; |
| 62 void RemoveDisplayObserver(WmDisplayObserver* observer) override; | 58 void RemoveDisplayObserver(WmDisplayObserver* observer) override; |
| 63 void AddShellObserver(ShellObserver* observer) override; | |
| 64 void RemoveShellObserver(ShellObserver* observer) override; | |
| 65 void AddPointerWatcher(views::PointerWatcher* watcher) override; | 59 void AddPointerWatcher(views::PointerWatcher* watcher) override; |
| 66 void RemovePointerWatcher(views::PointerWatcher* watcher) override; | 60 void RemovePointerWatcher(views::PointerWatcher* watcher) override; |
| 67 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 68 void ToggleIgnoreExternalKeyboard() override; | 62 void ToggleIgnoreExternalKeyboard() override; |
| 69 #endif | 63 #endif |
| 70 | 64 |
| 71 private: | 65 private: |
| 72 // aura::client::ActivationChangeObserver: | 66 // aura::client::ActivationChangeObserver: |
| 73 void OnWindowActivated(ActivationReason reason, | 67 void OnWindowActivated(ActivationReason reason, |
| 74 aura::Window* gained_active, | 68 aura::Window* gained_active, |
| 75 aura::Window* lost_active) override; | 69 aura::Window* lost_active) override; |
| 76 void OnAttemptToReactivateWindow(aura::Window* request_active, | 70 void OnAttemptToReactivateWindow(aura::Window* request_active, |
| 77 aura::Window* actual_active) override; | 71 aura::Window* actual_active) override; |
| 78 | 72 |
| 79 // WindowTreeHostManager::Observer: | 73 // WindowTreeHostManager::Observer: |
| 80 void OnDisplayConfigurationChanging() override; | 74 void OnDisplayConfigurationChanging() override; |
| 81 void OnDisplayConfigurationChanged() override; | 75 void OnDisplayConfigurationChanged() override; |
| 82 | 76 |
| 83 // Owned by Shell. | |
| 84 WmShellCommon* wm_shell_common_; | |
| 85 | |
| 86 WmLookupAura wm_lookup_; | 77 WmLookupAura wm_lookup_; |
| 87 bool added_activation_observer_ = false; | 78 bool added_activation_observer_ = false; |
| 88 base::ObserverList<WmActivationObserver> activation_observers_; | 79 base::ObserverList<WmActivationObserver> activation_observers_; |
| 89 | 80 |
| 90 bool added_display_observer_ = false; | 81 bool added_display_observer_ = false; |
| 91 base::ObserverList<WmDisplayObserver> display_observers_; | 82 base::ObserverList<WmDisplayObserver> display_observers_; |
| 92 | 83 |
| 93 DISALLOW_COPY_AND_ASSIGN(WmShellAura); | 84 DISALLOW_COPY_AND_ASSIGN(WmShellAura); |
| 94 }; | 85 }; |
| 95 | 86 |
| 96 } // namespace ash | 87 } // namespace ash |
| 97 | 88 |
| 98 #endif // ASH_AURA_WM_SHELL_AURA_H_ | 89 #endif // ASH_AURA_WM_SHELL_AURA_H_ |
| OLD | NEW |