OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/frame_host/frame_mojo_shell.h" | 5 #include "content/browser/frame_host/frame_mojo_shell.h" |
6 | 6 |
7 #include "content/browser/mojo/mojo_shell_context.h" | 7 #include "content/browser/mojo/mojo_shell_context.h" |
8 #include "content/common/mojo/service_registry_impl.h" | 8 #include "content/common/mojo/service_registry_impl.h" |
9 #include "content/public/browser/content_browser_client.h" | 9 #include "content/public/browser/content_browser_client.h" |
10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 mojo::InterfaceRequest<mojo::Shell> shell_request) { | 24 mojo::InterfaceRequest<mojo::Shell> shell_request) { |
25 bindings_.AddBinding(this, shell_request.Pass()); | 25 bindings_.AddBinding(this, shell_request.Pass()); |
26 } | 26 } |
27 | 27 |
28 // TODO(xhwang): Currently no callers are exposing |exposed_services|. So we | 28 // TODO(xhwang): Currently no callers are exposing |exposed_services|. So we |
29 // drop it and replace it with services we provide in the browser. In the | 29 // drop it and replace it with services we provide in the browser. In the |
30 // future we may need to support both. | 30 // future we may need to support both. |
31 void FrameMojoShell::ConnectToApplication( | 31 void FrameMojoShell::ConnectToApplication( |
32 mojo::URLRequestPtr application_url, | 32 mojo::URLRequestPtr application_url, |
33 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 33 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
34 mojo::ServiceProviderPtr /* exposed_services */) { | 34 mojo::ServiceProviderPtr /* exposed_services */, |
| 35 mojo::CapabilityFilterPtr filter) { |
35 mojo::ServiceProviderPtr frame_services; | 36 mojo::ServiceProviderPtr frame_services; |
36 service_provider_bindings_.AddBinding(GetServiceRegistry(), | 37 service_provider_bindings_.AddBinding(GetServiceRegistry(), |
37 GetProxy(&frame_services)); | 38 GetProxy(&frame_services)); |
38 | 39 |
39 MojoShellContext::ConnectToApplication( | 40 MojoShellContext::ConnectToApplication( |
40 GURL(application_url->url), frame_host_->GetSiteInstance()->GetSiteURL(), | 41 GURL(application_url->url), frame_host_->GetSiteInstance()->GetSiteURL(), |
41 services.Pass(), frame_services.Pass()); | 42 services.Pass(), frame_services.Pass(), filter.Pass()); |
42 } | 43 } |
43 | 44 |
44 void FrameMojoShell::QuitApplication() { | 45 void FrameMojoShell::QuitApplication() { |
45 } | 46 } |
46 | 47 |
47 ServiceRegistryImpl* FrameMojoShell::GetServiceRegistry() { | 48 ServiceRegistryImpl* FrameMojoShell::GetServiceRegistry() { |
48 if (!service_registry_) { | 49 if (!service_registry_) { |
49 service_registry_.reset(new ServiceRegistryImpl()); | 50 service_registry_.reset(new ServiceRegistryImpl()); |
50 | 51 |
51 GetContentClient()->browser()->RegisterFrameMojoShellServices( | 52 GetContentClient()->browser()->RegisterFrameMojoShellServices( |
52 service_registry_.get(), frame_host_); | 53 service_registry_.get(), frame_host_); |
53 } | 54 } |
54 | 55 |
55 return service_registry_.get(); | 56 return service_registry_.get(); |
56 } | 57 } |
57 | 58 |
58 } // namespace content | 59 } // namespace content |
OLD | NEW |