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

Unified Diff: mojo/services/public/cpp/view_manager/lib/node.cc

Issue 433513005: Pass ServiceProvider thru ViewManagerService::Embed() allowing embedder & embeddee to expose servic… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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: mojo/services/public/cpp/view_manager/lib/node.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/node.cc b/mojo/services/public/cpp/view_manager/lib/node.cc
index 738a5be97c4750e9f6db3e5e53282d1cc65e7297..f313d8aed26468ef75a9f394d378a74a03bafcd4 100644
--- a/mojo/services/public/cpp/view_manager/lib/node.cc
+++ b/mojo/services/public/cpp/view_manager/lib/node.cc
@@ -4,6 +4,7 @@
#include "mojo/services/public/cpp/view_manager/node.h"
+#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/services/public/cpp/view_manager/lib/node_private.h"
#include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h"
#include "mojo/services/public/cpp/view_manager/lib/view_private.h"
@@ -336,6 +337,21 @@ void Node::Embed(const String& url) {
static_cast<ViewManagerClientImpl*>(manager_)->Embed(url, id_);
}
+scoped_ptr<ServiceProvider>
+ Node::Embed(const String& url,
+ scoped_ptr<ServiceProviderImpl> exported_services) {
+ scoped_ptr<ServiceProvider> imported_services;
+ // BindToProxy() takes ownership of |exported_services|.
+ ServiceProviderImpl* registry = exported_services.release();
+ ServiceProviderPtr sp;
+ if (registry) {
+ BindToProxy(registry, &sp);
+ imported_services.reset(exported_services->CreateRemoteServiceProvider());
+ }
+ static_cast<ViewManagerClientImpl*>(manager_)->Embed(url, id_, sp.Pass());
+ return imported_services.Pass();
+}
+
////////////////////////////////////////////////////////////////////////////////
// Node, protected:
« no previous file with comments | « mojo/services/html_viewer/html_viewer.cc ('k') | mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698