| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/aura/wm_lookup_aura.h" | 11 #include "ash/aura/wm_lookup_aura.h" |
| 12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
| 13 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "ui/wm/public/activation_change_observer.h" | |
| 17 | 16 |
| 18 namespace ash { | 17 namespace ash { |
| 19 | 18 |
| 20 class PointerWatcherAdapter; | 19 class PointerWatcherAdapter; |
| 21 | 20 |
| 22 class ASH_EXPORT WmShellAura : public WmShell, | 21 class ASH_EXPORT WmShellAura : public WmShell, |
| 23 public aura::client::ActivationChangeObserver, | |
| 24 public WindowTreeHostManager::Observer { | 22 public WindowTreeHostManager::Observer { |
| 25 public: | 23 public: |
| 26 explicit WmShellAura(std::unique_ptr<ShellDelegate> shell_delegate); | 24 explicit WmShellAura(std::unique_ptr<ShellDelegate> shell_delegate); |
| 27 ~WmShellAura() override; | 25 ~WmShellAura() override; |
| 28 | 26 |
| 29 static WmShellAura* Get(); | 27 static WmShellAura* Get(); |
| 30 | 28 |
| 31 void CreatePointerWatcherAdapter(); | |
| 32 | 29 |
| 33 // WmShell: | 30 // WmShell: |
| 34 void Shutdown() override; | 31 void Shutdown() override; |
| 35 bool IsRunningInMash() const override; | 32 bool IsRunningInMash() const override; |
| 36 WmWindow* NewWindow(ui::wm::WindowType window_type, | 33 WmWindow* NewWindow(ui::wm::WindowType window_type, |
| 37 ui::LayerType layer_type) override; | 34 ui::LayerType layer_type) override; |
| 38 WmWindow* GetFocusedWindow() override; | 35 WmWindow* GetFocusedWindow() override; |
| 39 WmWindow* GetActiveWindow() override; | 36 WmWindow* GetActiveWindow() override; |
| 40 WmWindow* GetCaptureWindow() override; | 37 WmWindow* GetCaptureWindow() override; |
| 41 WmWindow* GetPrimaryRootWindow() override; | 38 WmWindow* GetPrimaryRootWindow() override; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 68 std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler( | 65 std::unique_ptr<WorkspaceEventHandler> CreateWorkspaceEventHandler( |
| 69 WmWindow* workspace_window) override; | 66 WmWindow* workspace_window) override; |
| 70 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> | 67 std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> |
| 71 CreateScopedDisableInternalMouseAndKeyboard() override; | 68 CreateScopedDisableInternalMouseAndKeyboard() override; |
| 72 std::unique_ptr<ImmersiveFullscreenController> | 69 std::unique_ptr<ImmersiveFullscreenController> |
| 73 CreateImmersiveFullscreenController() override; | 70 CreateImmersiveFullscreenController() override; |
| 74 std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() override; | 71 std::unique_ptr<KeyEventWatcher> CreateKeyEventWatcher() override; |
| 75 void OnOverviewModeStarting() override; | 72 void OnOverviewModeStarting() override; |
| 76 void OnOverviewModeEnded() override; | 73 void OnOverviewModeEnded() override; |
| 77 SessionStateDelegate* GetSessionStateDelegate() override; | 74 SessionStateDelegate* GetSessionStateDelegate() override; |
| 78 void AddActivationObserver(WmActivationObserver* observer) override; | |
| 79 void RemoveActivationObserver(WmActivationObserver* observer) override; | |
| 80 void AddDisplayObserver(WmDisplayObserver* observer) override; | 75 void AddDisplayObserver(WmDisplayObserver* observer) override; |
| 81 void RemoveDisplayObserver(WmDisplayObserver* observer) override; | 76 void RemoveDisplayObserver(WmDisplayObserver* observer) override; |
| 82 void AddPointerWatcher(views::PointerWatcher* watcher, | 77 void AddPointerWatcher(views::PointerWatcher* watcher, |
| 83 views::PointerWatcherEventTypes events) override; | 78 views::PointerWatcherEventTypes events) override; |
| 84 void RemovePointerWatcher(views::PointerWatcher* watcher) override; | 79 void RemovePointerWatcher(views::PointerWatcher* watcher) override; |
| 85 void RequestShutdown() override; | 80 void RequestShutdown() override; |
| 86 bool IsTouchDown() override; | 81 bool IsTouchDown() override; |
| 87 void ToggleIgnoreExternalKeyboard() override; | 82 void ToggleIgnoreExternalKeyboard() override; |
| 88 void SetLaserPointerEnabled(bool enabled) override; | 83 void SetLaserPointerEnabled(bool enabled) override; |
| 84 void CreatePointerWatcherAdapter() override; |
| 85 void CreatePrimaryHost() override; |
| 86 void InitHosts(const ShellInitParams& init_params) override; |
| 89 | 87 |
| 90 private: | 88 private: |
| 91 // aura::client::ActivationChangeObserver: | |
| 92 void OnWindowActivated(ActivationReason reason, | |
| 93 aura::Window* gained_active, | |
| 94 aura::Window* lost_active) override; | |
| 95 void OnAttemptToReactivateWindow(aura::Window* request_active, | |
| 96 aura::Window* actual_active) override; | |
| 97 | |
| 98 // SessionStateObserver: | 89 // SessionStateObserver: |
| 99 void SessionStateChanged(session_manager::SessionState state) override; | 90 void SessionStateChanged(session_manager::SessionState state) override; |
| 100 | 91 |
| 101 // WindowTreeHostManager::Observer: | 92 // WindowTreeHostManager::Observer: |
| 102 void OnDisplayConfigurationChanging() override; | 93 void OnDisplayConfigurationChanging() override; |
| 103 void OnDisplayConfigurationChanged() override; | 94 void OnDisplayConfigurationChanged() override; |
| 104 | 95 |
| 105 WmLookupAura wm_lookup_; | 96 WmLookupAura wm_lookup_; |
| 106 std::unique_ptr<PointerWatcherAdapter> pointer_watcher_adapter_; | 97 std::unique_ptr<PointerWatcherAdapter> pointer_watcher_adapter_; |
| 107 | 98 |
| 108 bool added_activation_observer_ = false; | |
| 109 base::ObserverList<WmActivationObserver> activation_observers_; | |
| 110 | |
| 111 bool added_display_observer_ = false; | 99 bool added_display_observer_ = false; |
| 112 base::ObserverList<WmDisplayObserver> display_observers_; | 100 base::ObserverList<WmDisplayObserver> display_observers_; |
| 113 | 101 |
| 114 DISALLOW_COPY_AND_ASSIGN(WmShellAura); | 102 DISALLOW_COPY_AND_ASSIGN(WmShellAura); |
| 115 }; | 103 }; |
| 116 | 104 |
| 117 } // namespace ash | 105 } // namespace ash |
| 118 | 106 |
| 119 #endif // ASH_AURA_WM_SHELL_AURA_H_ | 107 #endif // ASH_AURA_WM_SHELL_AURA_H_ |
| OLD | NEW |