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

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

Issue 1615023004: Start of display management for mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash and add back getting constants Created 4 years, 11 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
Index: components/mus/ws/connection_manager.h
diff --git a/components/mus/ws/connection_manager.h b/components/mus/ws/connection_manager.h
index 79210b5548038457892405dc2346e7033c5f9546..922ac5f637abb18bdb8a95484100cd967c6bee88 100644
--- a/components/mus/ws/connection_manager.h
+++ b/components/mus/ws/connection_manager.h
@@ -14,6 +14,7 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
+#include "components/mus/public/interfaces/display.mojom.h"
#include "components/mus/public/interfaces/window_tree.mojom.h"
#include "components/mus/public/interfaces/window_tree_host.mojom.h"
#include "components/mus/surfaces/surfaces_state.h"
@@ -22,6 +23,8 @@
#include "components/mus/ws/server_window_delegate.h"
#include "components/mus/ws/server_window_observer.h"
#include "components/mus/ws/window_tree_host_impl.h"
+#include "mojo/common/weak_binding_set.h"
+#include "mojo/common/weak_interface_ptr_set.h"
#include "mojo/converters/surfaces/custom_surface_converter.h"
#include "mojo/public/cpp/bindings/array.h"
#include "mojo/public/cpp/bindings/binding.h"
@@ -37,8 +40,12 @@ class WindowTreeImpl;
// ConnectionManager manages the set of connections to the window server (all
// the WindowTreeImpls) as well as providing the root of the hierarchy.
+//
+// TODO(sky): this class is doing too much. Refactor to make responsibilities
+// clearer.
class ConnectionManager : public ServerWindowDelegate,
- public ServerWindowObserver {
+ public ServerWindowObserver,
+ public mojom::DisplayManager {
public:
ConnectionManager(ConnectionManagerDelegate* delegate,
const scoped_refptr<mus::SurfacesState>& surfaces_state);
@@ -125,6 +132,9 @@ class ConnectionManager : public ServerWindowDelegate,
return !host_connection_map_.empty();
}
+ void AddDisplayManagerBinding(
+ mojo::InterfaceRequest<mojom::DisplayManager> request);
+
// Returns a change id for the window manager that is associated with
// |source| and |client_change_id|. When the window manager replies
// WindowManagerChangeCompleted() is called to obtain the original source
@@ -254,6 +264,9 @@ class ConnectionManager : public ServerWindowDelegate,
void OnTransientWindowRemoved(ServerWindow* window,
ServerWindow* transient_child) override;
+ // Overriden from mojom::DisplayManager:
+ void AddObserver(mojom::DisplayManagerObserverPtr observer) override;
+
ConnectionManagerDelegate* delegate_;
// State for rendering into a Surface.
@@ -284,6 +297,10 @@ class ConnectionManager : public ServerWindowDelegate,
// Next id supplied to the window manager.
uint32_t next_wm_change_id_;
+ mojo::WeakBindingSet<mojom::DisplayManager> display_manager_bindings_;
+ mojo::WeakInterfacePtrSet<mojom::DisplayManagerObserver>
+ display_manager_observers_;
+
DISALLOW_COPY_AND_ASSIGN(ConnectionManager);
};
« no previous file with comments | « components/mus/public/interfaces/window_manager_constants.mojom ('k') | components/mus/ws/connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698