| Index: components/mus/ws/window_tree_host_impl.h
|
| diff --git a/components/mus/ws/window_tree_host_impl.h b/components/mus/ws/window_tree_host_impl.h
|
| index 0a5574f8939a3558b9ab026dd40801fafe2d53ca..ea9140bfc819d1d79d4ff539012670ab386cfff9 100644
|
| --- a/components/mus/ws/window_tree_host_impl.h
|
| +++ b/components/mus/ws/window_tree_host_impl.h
|
| @@ -24,6 +24,8 @@
|
| #include "components/mus/ws/server_window.h"
|
| #include "components/mus/ws/server_window_observer.h"
|
| #include "components/mus/ws/server_window_tracker.h"
|
| +#include "components/mus/ws/user_id_tracker_observer.h"
|
| +#include "components/mus/ws/window_manager_factory_registry_observer.h"
|
|
|
| namespace mus {
|
| namespace ws {
|
| @@ -34,6 +36,10 @@ class WindowManagerState;
|
| class WindowTreeHostConnection;
|
| class WindowTreeImpl;
|
|
|
| +namespace test {
|
| +class WindowTreeHostTestApi;
|
| +}
|
| +
|
| // WindowTreeHostImpl is an implementation of the WindowTreeHost interface.
|
| // It serves as a top level root window for a window. Its lifetime is managed by
|
| // ConnectionManager. If the connection to the client breaks or if the user
|
| @@ -53,7 +59,9 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
|
| public FocusControllerObserver,
|
| public FocusControllerDelegate,
|
| public EventDispatcherDelegate,
|
| - public ServerWindowObserver {
|
| + public ServerWindowObserver,
|
| + public UserIdTrackerObserver,
|
| + public WindowManagerFactoryRegistryObserver {
|
| public:
|
| // TODO(fsamuel): All these parameters are just plumbing for creating
|
| // DisplayManagers. We should probably just store these common parameters
|
| @@ -105,6 +113,10 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
|
| WindowManagerState* GetWindowManagerStateWithRoot(const ServerWindow* window);
|
| // TODO(sky): this is wrong, plumb through user_id.
|
| WindowManagerState* GetFirstWindowManagerState();
|
| + WindowManagerState* GetWindowManagerStateForUser(UserId user_id);
|
| + size_t num_window_manger_states() const {
|
| + return window_manager_state_map_.size();
|
| + }
|
|
|
| void SetCapture(ServerWindow* window, bool in_nonclient_area);
|
|
|
| @@ -149,7 +161,8 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
|
|
|
| private:
|
| class ProcessedEventTarget;
|
| - friend class WindowTreeTest;
|
| + friend class test::WindowTreeHostTestApi;
|
| +
|
| using WindowManagerStateMap =
|
| std::map<uint32_t, scoped_ptr<WindowManagerState>>;
|
|
|
| @@ -192,6 +205,9 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
|
| // WindowManagerFactoryRegistry.
|
| void CreateWindowManagerStatesFromRegistry();
|
|
|
| + void CreateWindowManagerStateFromService(
|
| + WindowManagerFactoryService* service);
|
| +
|
| void UpdateNativeCursor(int32_t cursor_id);
|
|
|
| // DisplayManagerDelegate:
|
| @@ -229,6 +245,14 @@ class WindowTreeHostImpl : public DisplayManagerDelegate,
|
| // ServerWindowObserver:
|
| void OnWindowDestroyed(ServerWindow* window) override;
|
|
|
| + // UserIdTrackerObserver:
|
| + void OnActiveUserIdChanged(UserId id) override;
|
| + void OnUserIdAdded(UserId id) override;
|
| + void OnUserIdRemoved(UserId id) override;
|
| +
|
| + // WindowManagerFactoryRegistryObserver:
|
| + void OnWindowManagerFactorySet(WindowManagerFactoryService* service) override;
|
| +
|
| const uint32_t id_;
|
| scoped_ptr<WindowTreeHostConnection> window_tree_host_connection_;
|
| // Set once Init() has been called.
|
|
|