| 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_MUS_BRIDGE_WM_SHELL_MUS_H_ | 5 #ifndef ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| 6 #define ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | 6 #define ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "components/mus/public/cpp/window_tree_client_observer.h" | 15 #include "components/mus/public/cpp/window_tree_client_observer.h" |
| 16 | 16 |
| 17 namespace mus { | 17 namespace mus { |
| 18 class WindowTreeClient; | 18 class WindowTreeClient; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace ash { | 21 namespace ash { |
| 22 |
| 23 class WmShellCommon; |
| 24 |
| 22 namespace mus { | 25 namespace mus { |
| 23 | 26 |
| 24 class WmRootWindowControllerMus; | 27 class WmRootWindowControllerMus; |
| 25 class WmWindowMus; | 28 class WmWindowMus; |
| 26 | 29 |
| 27 // WmShell implementation for mus. | 30 // WmShell implementation for mus. |
| 28 class WmShellMus : public WmShell, public ::mus::WindowTreeClientObserver { | 31 class WmShellMus : public WmShell, public ::mus::WindowTreeClientObserver { |
| 29 public: | 32 public: |
| 30 explicit WmShellMus(::mus::WindowTreeClient* client); | 33 explicit WmShellMus(::mus::WindowTreeClient* client); |
| 31 ~WmShellMus() override; | 34 ~WmShellMus() override; |
| 32 | 35 |
| 33 static WmShellMus* Get(); | 36 static WmShellMus* Get(); |
| 34 | 37 |
| 35 void AddRootWindowController(WmRootWindowControllerMus* controller); | 38 void AddRootWindowController(WmRootWindowControllerMus* controller); |
| 36 void RemoveRootWindowController(WmRootWindowControllerMus* controller); | 39 void RemoveRootWindowController(WmRootWindowControllerMus* controller); |
| 37 | 40 |
| 38 // Returns the ancestor of |window| (including |window|) that is considered | 41 // Returns the ancestor of |window| (including |window|) that is considered |
| 39 // toplevel. |window| may be null. | 42 // toplevel. |window| may be null. |
| 40 static WmWindowMus* GetToplevelAncestor(::mus::Window* window); | 43 static WmWindowMus* GetToplevelAncestor(::mus::Window* window); |
| 41 | 44 |
| 42 WmRootWindowControllerMus* GetRootWindowControllerWithDisplayId(int64_t id); | 45 WmRootWindowControllerMus* GetRootWindowControllerWithDisplayId(int64_t id); |
| 43 | 46 |
| 44 // WmShell: | 47 // WmShell: |
| 48 MruWindowTracker* GetMruWindowTracker() override; |
| 45 WmWindow* NewContainerWindow() override; | 49 WmWindow* NewContainerWindow() override; |
| 46 WmWindow* GetFocusedWindow() override; | 50 WmWindow* GetFocusedWindow() override; |
| 47 WmWindow* GetActiveWindow() override; | 51 WmWindow* GetActiveWindow() override; |
| 48 WmWindow* GetPrimaryRootWindow() override; | 52 WmWindow* GetPrimaryRootWindow() override; |
| 49 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; | 53 WmWindow* GetRootWindowForDisplayId(int64_t display_id) override; |
| 50 WmWindow* GetRootWindowForNewWindows() override; | 54 WmWindow* GetRootWindowForNewWindows() override; |
| 51 std::vector<WmWindow*> GetMruWindowList() override; | |
| 52 std::vector<WmWindow*> GetMruWindowListIgnoreModals() override; | |
| 53 bool IsForceMaximizeOnFirstRun() override; | 55 bool IsForceMaximizeOnFirstRun() override; |
| 54 bool CanShowWindowForUser(WmWindow* window) override; | 56 bool CanShowWindowForUser(WmWindow* window) override; |
| 55 void LockCursor() override; | 57 void LockCursor() override; |
| 56 void UnlockCursor() override; | 58 void UnlockCursor() override; |
| 57 std::vector<WmWindow*> GetAllRootWindows() override; | 59 std::vector<WmWindow*> GetAllRootWindows() override; |
| 58 void RecordUserMetricsAction(wm::WmUserMetricsAction action) override; | 60 void RecordUserMetricsAction(wm::WmUserMetricsAction action) override; |
| 59 std::unique_ptr<WindowResizer> CreateDragWindowResizer( | 61 std::unique_ptr<WindowResizer> CreateDragWindowResizer( |
| 60 std::unique_ptr<WindowResizer> next_window_resizer, | 62 std::unique_ptr<WindowResizer> next_window_resizer, |
| 61 wm::WindowState* window_state) override; | 63 wm::WindowState* window_state) override; |
| 62 bool IsOverviewModeSelecting() override; | 64 bool IsOverviewModeSelecting() override; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 75 | 77 |
| 76 void RemoveClientObserver(); | 78 void RemoveClientObserver(); |
| 77 | 79 |
| 78 // ::mus::WindowTreeClientObserver: | 80 // ::mus::WindowTreeClientObserver: |
| 79 void OnWindowTreeFocusChanged(::mus::Window* gained_focus, | 81 void OnWindowTreeFocusChanged(::mus::Window* gained_focus, |
| 80 ::mus::Window* lost_focus) override; | 82 ::mus::Window* lost_focus) override; |
| 81 void OnWillDestroyClient(::mus::WindowTreeClient* client) override; | 83 void OnWillDestroyClient(::mus::WindowTreeClient* client) override; |
| 82 | 84 |
| 83 ::mus::WindowTreeClient* client_; | 85 ::mus::WindowTreeClient* client_; |
| 84 | 86 |
| 87 std::unique_ptr<WmShellCommon> wm_shell_common_; |
| 88 |
| 85 std::vector<WmRootWindowControllerMus*> root_window_controllers_; | 89 std::vector<WmRootWindowControllerMus*> root_window_controllers_; |
| 86 | 90 |
| 87 std::unique_ptr<SessionStateDelegate> session_state_delegate_; | 91 std::unique_ptr<SessionStateDelegate> session_state_delegate_; |
| 88 | 92 |
| 89 base::ObserverList<WmActivationObserver> activation_observers_; | 93 base::ObserverList<WmActivationObserver> activation_observers_; |
| 90 | 94 |
| 91 DISALLOW_COPY_AND_ASSIGN(WmShellMus); | 95 DISALLOW_COPY_AND_ASSIGN(WmShellMus); |
| 92 }; | 96 }; |
| 93 | 97 |
| 94 } // namespace mus | 98 } // namespace mus |
| 95 } // namespace ash | 99 } // namespace ash |
| 96 | 100 |
| 97 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ | 101 #endif // ASH_MUS_BRIDGE_WM_SHELL_MUS_H_ |
| OLD | NEW |