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

Unified Diff: content/browser/frame_host/frame_mojo_shell.cc

Issue 1209283003: FrameMojoShell provides services to mojo apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use WeakBindingSet rebase Created 5 years, 5 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 | « content/browser/frame_host/frame_mojo_shell.h ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_mojo_shell.cc
diff --git a/content/browser/frame_host/frame_mojo_shell.cc b/content/browser/frame_host/frame_mojo_shell.cc
index 6823931ea20f0a1285b4b56b52168e826f34fcbb..313ca6d63472365da22c9aa63a0dc24ff29d7241 100644
--- a/content/browser/frame_host/frame_mojo_shell.cc
+++ b/content/browser/frame_host/frame_mojo_shell.cc
@@ -5,8 +5,12 @@
#include "content/browser/frame_host/frame_mojo_shell.h"
#include "content/browser/mojo/mojo_shell_context.h"
+#include "content/common/mojo/service_registry_impl.h"
+#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/site_instance.h"
+#include "content/public/common/content_client.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
Ken Rockot(use gerrit already) 2015/07/07 19:25:46 nit: can remove this now
xhwang 2015/07/07 19:31:41 Done.
namespace content {
@@ -22,16 +26,34 @@ void FrameMojoShell::BindRequest(
bindings_.AddBinding(this, shell_request.Pass());
}
+// TODO(xhwang): Currently no callers are exposing |exposed_services|. So we
+// drop it and replace it with services we provide in the browser. In the
+// future we may need to support both.
void FrameMojoShell::ConnectToApplication(
mojo::URLRequestPtr application_url,
mojo::InterfaceRequest<mojo::ServiceProvider> services,
- mojo::ServiceProviderPtr exposed_services) {
+ mojo::ServiceProviderPtr /* exposed_services */) {
+ mojo::ServiceProviderPtr frame_services;
+ service_provider_bindings_.AddBinding(GetServiceRegistry(),
+ GetProxy(&frame_services));
+
MojoShellContext::ConnectToApplication(
GURL(application_url->url), frame_host_->GetSiteInstance()->GetSiteURL(),
- services.Pass());
+ services.Pass(), frame_services.Pass());
}
void FrameMojoShell::QuitApplication() {
}
+ServiceRegistryImpl* FrameMojoShell::GetServiceRegistry() {
+ if (!service_registry_) {
+ service_registry_.reset(new ServiceRegistryImpl());
+
+ GetContentClient()->browser()->OverrideFrameMojoShellServices(
+ service_registry_.get(), frame_host_);
+ }
+
+ return service_registry_.get();
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/frame_mojo_shell.h ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698