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

Unified Diff: services/view_manager/connection_manager.cc

Issue 905083002: Adds Embed() variant to ViewManagerService that takes ViewManagerClient (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: real comments Created 5 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
Index: services/view_manager/connection_manager.cc
diff --git a/services/view_manager/connection_manager.cc b/services/view_manager/connection_manager.cc
index ce2bb9cf45c81318d69091c60418f33111aa7c85..8e06304b8d77d774ad017aa616cbcaa066b229d5 100644
--- a/services/view_manager/connection_manager.cc
+++ b/services/view_manager/connection_manager.cc
@@ -182,6 +182,25 @@ void ConnectionManager::EmbedAtView(
OnConnectionMessagedClient(client_connection->service()->id());
}
+void ConnectionManager::EmbedAtView(mojo::ConnectionSpecificId creator_id,
+ const ViewId& view_id,
+ mojo::ViewManagerClientPtr client) {
+ std::string creator_url;
+ ConnectionMap::const_iterator it = connection_map_.find(creator_id);
+ if (it != connection_map_.end())
+ creator_url = it->second->service()->url();
+
+ mojo::ViewManagerServicePtr service_ptr;
+ ClientConnection* client_connection =
+ delegate_->CreateClientConnectionForEmbedAtView(
+ this, GetProxy(&service_ptr), creator_id, creator_url, view_id,
+ client.Pass());
+ AddConnection(client_connection);
+ client_connection->service()->Init(client_connection->client(),
+ service_ptr.Pass(), nullptr, nullptr);
+ OnConnectionMessagedClient(client_connection->service()->id());
+}
+
ViewManagerServiceImpl* ConnectionManager::GetConnection(
ConnectionSpecificId connection_id) {
ConnectionMap::iterator i = connection_map_.find(connection_id);

Powered by Google App Engine
This is Rietveld 408576698