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

Unified Diff: components/mus/mus_app.cc

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
« no previous file with comments | « components/mus/mus_app.h ('k') | components/mus/public/interfaces/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/mus_app.cc
diff --git a/components/mus/mus_app.cc b/components/mus/mus_app.cc
index 25b97a0717d7920cb9a70bf2f2812406fadb2287..c2dc704eef76632397cf8e7a71c38f364c50414e 100644
--- a/components/mus/mus_app.cc
+++ b/components/mus/mus_app.cc
@@ -39,6 +39,11 @@ using mus::mojom::Gpu;
namespace mus {
+struct MandolineUIServicesApp::PendingRequest {
+ scoped_ptr<mojo::InterfaceRequest<mojom::DisplayManager>> dm_request;
+ scoped_ptr<mojo::InterfaceRequest<mojom::WindowManager>> wm_request;
+};
+
MandolineUIServicesApp::MandolineUIServicesApp()
: app_impl_(nullptr) {}
@@ -87,16 +92,21 @@ void MandolineUIServicesApp::Initialize(ApplicationImpl* app) {
bool MandolineUIServicesApp::ConfigureIncomingConnection(
ApplicationConnection* connection) {
connection->AddService<Gpu>(this);
+ connection->AddService<mojom::DisplayManager>(this);
connection->AddService<mojom::WindowManager>(this);
connection->AddService<WindowTreeHostFactory>(this);
return true;
}
void MandolineUIServicesApp::OnFirstRootConnectionCreated() {
- WindowManagerRequests requests;
- requests.swap(pending_window_manager_requests_);
- for (auto& request : requests)
- Create(nullptr, std::move(*request));
+ PendingRequests requests;
+ requests.swap(pending_requests_);
+ for (auto& request : requests) {
+ if (request->dm_request)
+ Create(nullptr, std::move(*request->dm_request));
+ else
+ Create(nullptr, std::move(*request->wm_request));
+ }
}
void MandolineUIServicesApp::OnNoMoreRootConnections() {
@@ -119,10 +129,25 @@ MandolineUIServicesApp::CreateClientConnectionForEmbedAtWindow(
void MandolineUIServicesApp::Create(
mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojom::DisplayManager> request) {
+ if (!connection_manager_->has_tree_host_connections()) {
+ scoped_ptr<PendingRequest> pending_request(new PendingRequest);
+ pending_request->dm_request.reset(
+ new mojo::InterfaceRequest<mojom::DisplayManager>(std::move(request)));
+ pending_requests_.push_back(std::move(pending_request));
+ return;
+ }
+ connection_manager_->AddDisplayManagerBinding(std::move(request));
+}
+
+void MandolineUIServicesApp::Create(
+ mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mojom::WindowManager> request) {
if (!connection_manager_->has_tree_host_connections()) {
- pending_window_manager_requests_.push_back(make_scoped_ptr(
- new mojo::InterfaceRequest<mojom::WindowManager>(std::move(request))));
+ scoped_ptr<PendingRequest> pending_request(new PendingRequest);
+ pending_request->wm_request.reset(
+ new mojo::InterfaceRequest<mojom::WindowManager>(std::move(request)));
+ pending_requests_.push_back(std::move(pending_request));
return;
}
if (!window_manager_impl_) {
« no previous file with comments | « components/mus/mus_app.h ('k') | components/mus/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698