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 MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ | 5 #ifndef MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ |
6 #define MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ | 6 #define MASH_WM_BRIDGE_WM_GLOBALS_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/wm/common/wm_globals.h" | 12 #include "ash/wm/common/wm_globals.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_connection_observer.h" | 15 #include "components/mus/public/cpp/window_tree_client_observer.h" |
16 | 16 |
17 namespace mus { | 17 namespace mus { |
18 class WindowTreeConnection; | 18 class WindowTreeClient; |
19 } | 19 } |
20 | 20 |
21 namespace mash { | 21 namespace mash { |
22 namespace wm { | 22 namespace wm { |
23 | 23 |
24 class WmRootWindowControllerMus; | 24 class WmRootWindowControllerMus; |
25 class WmWindowMus; | 25 class WmWindowMus; |
26 | 26 |
27 // WmGlobals implementation for mus. | 27 // WmGlobals implementation for mus. |
28 class WmGlobalsMus : public ash::wm::WmGlobals, | 28 class WmGlobalsMus : public ash::wm::WmGlobals, |
29 public mus::WindowTreeConnectionObserver { | 29 public mus::WindowTreeClientObserver { |
30 public: | 30 public: |
31 explicit WmGlobalsMus(mus::WindowTreeConnection* connection); | 31 explicit WmGlobalsMus(mus::WindowTreeClient* client); |
32 ~WmGlobalsMus() override; | 32 ~WmGlobalsMus() override; |
33 | 33 |
34 static WmGlobalsMus* Get(); | 34 static WmGlobalsMus* Get(); |
35 | 35 |
36 void AddRootWindowController(WmRootWindowControllerMus* controller); | 36 void AddRootWindowController(WmRootWindowControllerMus* controller); |
37 void RemoveRootWindowController(WmRootWindowControllerMus* controller); | 37 void RemoveRootWindowController(WmRootWindowControllerMus* controller); |
38 | 38 |
39 // Returns the ancestor of |window| (including |window|) that is considered | 39 // Returns the ancestor of |window| (including |window|) that is considered |
40 // toplevel. |window| may be null. | 40 // toplevel. |window| may be null. |
41 static WmWindowMus* GetToplevelAncestor(mus::Window* window); | 41 static WmWindowMus* GetToplevelAncestor(mus::Window* window); |
(...skipping 25 matching lines...) Expand all Loading... |
67 void RemoveDisplayObserver(ash::wm::WmDisplayObserver* observer) override; | 67 void RemoveDisplayObserver(ash::wm::WmDisplayObserver* observer) override; |
68 void AddOverviewModeObserver( | 68 void AddOverviewModeObserver( |
69 ash::wm::WmOverviewModeObserver* observer) override; | 69 ash::wm::WmOverviewModeObserver* observer) override; |
70 void RemoveOverviewModeObserver( | 70 void RemoveOverviewModeObserver( |
71 ash::wm::WmOverviewModeObserver* observer) override; | 71 ash::wm::WmOverviewModeObserver* observer) override; |
72 | 72 |
73 private: | 73 private: |
74 // Returns true if |window| is a window that can have active children. | 74 // Returns true if |window| is a window that can have active children. |
75 static bool IsActivationParent(mus::Window* window); | 75 static bool IsActivationParent(mus::Window* window); |
76 | 76 |
77 void RemoveConnectionObserver(); | 77 void RemoveClientObserver(); |
78 | 78 |
79 // mus::WindowTreeConnectionObserver: | 79 // mus::WindowTreeClientObserver: |
80 void OnWindowTreeFocusChanged(mus::Window* gained_focus, | 80 void OnWindowTreeFocusChanged(mus::Window* gained_focus, |
81 mus::Window* lost_focus) override; | 81 mus::Window* lost_focus) override; |
82 void OnWillDestroyConnection(mus::WindowTreeConnection* connection) override; | 82 void OnWillDestroyClient(mus::WindowTreeClient* client) override; |
83 | 83 |
84 mus::WindowTreeConnection* connection_; | 84 mus::WindowTreeClient* client_; |
85 | 85 |
86 std::vector<WmRootWindowControllerMus*> root_window_controllers_; | 86 std::vector<WmRootWindowControllerMus*> root_window_controllers_; |
87 | 87 |
88 base::ObserverList<ash::wm::WmActivationObserver> activation_observers_; | 88 base::ObserverList<ash::wm::WmActivationObserver> activation_observers_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(WmGlobalsMus); | 90 DISALLOW_COPY_AND_ASSIGN(WmGlobalsMus); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace wm | 93 } // namespace wm |
94 } // namespace mash | 94 } // namespace mash |
95 | 95 |
96 #endif // MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ | 96 #endif // MASH_WM_BRIDGE_WM_GLOBALS_MUS_H_ |
OLD | NEW |