Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: components/mus/ws/connection_manager.h

Issue 1755223002: Adds WindowManagerManager to mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and WindowManagerState Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/client_connection.cc ('k') | components/mus/ws/connection_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/connection_manager.h
diff --git a/components/mus/ws/connection_manager.h b/components/mus/ws/connection_manager.h
index c35b03bcaa8af9f848533fdde9c2ace37242afe3..b48386742f50c320a2be8fdefce143813d1a7ae6 100644
--- a/components/mus/ws/connection_manager.h
+++ b/components/mus/ws/connection_manager.h
@@ -23,6 +23,7 @@
#include "components/mus/ws/operation.h"
#include "components/mus/ws/server_window_delegate.h"
#include "components/mus/ws/server_window_observer.h"
+#include "components/mus/ws/window_manager_factory_registry.h"
#include "components/mus/ws/window_tree_host_impl.h"
#include "mojo/converters/surfaces/custom_surface_converter.h"
#include "mojo/public/cpp/bindings/array.h"
@@ -36,10 +37,25 @@ namespace ws {
class ClientConnection;
class ConnectionManagerDelegate;
class ServerWindow;
-class WindowManagerFactoryService;
+class WindowManagerState;
class WindowTreeHostConnection;
class WindowTreeImpl;
+struct WindowManagerAndHost {
+ WindowManagerAndHost()
+ : window_manager_state(nullptr), window_tree_host(nullptr) {}
+
+ WindowManagerState* window_manager_state;
+ WindowTreeHostImpl* window_tree_host;
+};
+
+struct WindowManagerAndHostConst {
+ WindowManagerAndHostConst()
+ : window_manager_state(nullptr), window_tree_host(nullptr) {}
+ const WindowManagerState* window_manager_state;
+ const WindowTreeHostImpl* window_tree_host;
+};
+
// ConnectionManager manages the set of connections to the window server (all
// the WindowTreeImpls) as well as providing the root of the hierarchy.
//
@@ -53,6 +69,8 @@ class ConnectionManager : public ServerWindowDelegate,
const scoped_refptr<mus::SurfacesState>& surfaces_state);
~ConnectionManager() override;
+ ConnectionManagerDelegate* delegate() { return delegate_; }
+
// Adds/removes a WindowTreeHost. ConnectionManager owns the
// WindowTreeHostImpls.
void AddHost(WindowTreeHostImpl* host);
@@ -75,8 +93,6 @@ class ConnectionManager : public ServerWindowDelegate,
ClientConnection* GetClientConnection(WindowTreeImpl* window_tree);
- void OnHostConnectionClosed(WindowTreeHostImpl* host);
-
// See description of WindowTree::Embed() for details. This assumes
// |transport_window_id| is valid.
WindowTreeImpl* EmbedAtWindow(ServerWindow* root,
@@ -93,10 +109,6 @@ class ConnectionManager : public ServerWindowDelegate,
// Returns the Window identified by |id|.
ServerWindow* GetWindow(const WindowId& id);
- // Returns whether |window| is a descendant of some root window but not itself
- // a root window.
- bool IsWindowAttachedToRoot(const ServerWindow* window) const;
-
// Schedules a paint for the specified region in the coordinates of |window|.
void SchedulePaint(const ServerWindow* window, const gfx::Rect& bounds);
@@ -135,6 +147,10 @@ class ConnectionManager : public ServerWindowDelegate,
const WindowTreeHostImpl* GetWindowTreeHostByWindow(
const ServerWindow* window) const;
+ WindowManagerAndHostConst GetWindowManagerAndHost(
+ const ServerWindow* window) const;
+ WindowManagerAndHost GetWindowManagerAndHost(const ServerWindow* window);
+
WindowTreeHostImpl* GetActiveWindowTreeHost();
bool has_tree_host_connections() const { return !hosts_.empty(); }
@@ -143,7 +159,13 @@ class ConnectionManager : public ServerWindowDelegate,
mojo::InterfaceRequest<mojom::DisplayManager> request);
void CreateWindowManagerFactoryService(
+ const uint32_t user_id,
mojo::InterfaceRequest<mojom::WindowManagerFactoryService> request);
+ void OnWindowManagerFactorySet();
+
+ WindowManagerFactoryRegistry* window_manager_factory_registry() {
+ return &window_manager_factory_registry_;
+ }
// Returns a change id for the window manager that is associated with
// |source| and |client_change_id|. When the window manager replies
@@ -165,9 +187,11 @@ class ConnectionManager : public ServerWindowDelegate,
// TODO(sky): decide what we want to do here.
void WindowManagerSentBogusMessage() {}
+ // Returns the Display for |host|.
+ mojom::DisplayPtr DisplayForHost(WindowTreeHostImpl* host);
+
// These functions trivially delegate to all WindowTreeImpls, which in
// term notify their clients.
- void ProcessWindowDestroyed(ServerWindow* window);
void ProcessWindowBoundsChanged(const ServerWindow* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds);
@@ -242,9 +266,6 @@ class ConnectionManager : public ServerWindowDelegate,
void CallOnDisplayChanged(mojom::DisplayManagerObserver* observer,
WindowTreeHostImpl* host);
- // Returns the Display for |host|.
- mojom::DisplayPtr DisplayForHost(WindowTreeHostImpl* host);
-
// Overridden from ServerWindowDelegate:
mus::SurfacesState* GetSurfacesState() override;
void OnScheduleWindowPaint(const ServerWindow* window) override;
@@ -331,7 +352,7 @@ class ConnectionManager : public ServerWindowDelegate,
bool got_valid_frame_decorations_;
- scoped_ptr<WindowManagerFactoryService> window_manager_factory_service_;
+ WindowManagerFactoryRegistry window_manager_factory_registry_;
DISALLOW_COPY_AND_ASSIGN(ConnectionManager);
};
« no previous file with comments | « components/mus/ws/client_connection.cc ('k') | components/mus/ws/connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698