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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/browser/mojo/mojo_shell_context.h" | 10 #include "content/browser/mojo/mojo_shell_context.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 void FrameMojoShell::BindRequest( | 42 void FrameMojoShell::BindRequest( |
43 mojo::InterfaceRequest<mojo::shell::mojom::Shell> shell_request) { | 43 mojo::InterfaceRequest<mojo::shell::mojom::Shell> shell_request) { |
44 bindings_.AddBinding(this, std::move(shell_request)); | 44 bindings_.AddBinding(this, std::move(shell_request)); |
45 } | 45 } |
46 | 46 |
47 // TODO(xhwang): Currently no callers are exposing |exposed_services|. So we | 47 // TODO(xhwang): Currently no callers are exposing |exposed_services|. So we |
48 // drop it and replace it with services we provide in the browser. In the | 48 // drop it and replace it with services we provide in the browser. In the |
49 // future we may need to support both. | 49 // future we may need to support both. |
50 void FrameMojoShell::ConnectToApplication( | 50 void FrameMojoShell::ConnectToApplication( |
51 mojo::URLRequestPtr application_url, | 51 mojo::URLRequestPtr application_url, |
52 mojo::InterfaceRequest<mojo::InterfaceProvider> services, | 52 mojo::shell::mojom::InterfaceProviderRequest services, |
53 mojo::InterfaceProviderPtr /* exposed_services */, | 53 mojo::shell::mojom::InterfaceProviderPtr /* exposed_services */, |
54 mojo::shell::mojom::CapabilityFilterPtr filter, | 54 mojo::shell::mojom::CapabilityFilterPtr filter, |
55 const ConnectToApplicationCallback& callback) { | 55 const ConnectToApplicationCallback& callback) { |
56 mojo::InterfaceProviderPtr frame_services; | 56 mojo::shell::mojom::InterfaceProviderPtr frame_services; |
57 service_provider_bindings_.AddBinding(GetServiceRegistry(), | 57 service_provider_bindings_.AddBinding(GetServiceRegistry(), |
58 GetProxy(&frame_services)); | 58 GetProxy(&frame_services)); |
59 | 59 |
60 mojo::shell::CapabilityFilter capability_filter = | 60 mojo::shell::CapabilityFilter capability_filter = |
61 mojo::shell::GetPermissiveCapabilityFilter(); | 61 mojo::shell::GetPermissiveCapabilityFilter(); |
62 if (!filter.is_null()) | 62 if (!filter.is_null()) |
63 capability_filter = filter->filter.To<mojo::shell::CapabilityFilter>(); | 63 capability_filter = filter->filter.To<mojo::shell::CapabilityFilter>(); |
64 MojoShellContext::ConnectToApplication( | 64 MojoShellContext::ConnectToApplication( |
65 GURL(application_url->url.get()), | 65 GURL(application_url->url.get()), |
66 frame_host_->GetSiteInstance()->GetSiteURL(), std::move(services), | 66 frame_host_->GetSiteInstance()->GetSiteURL(), std::move(services), |
(...skipping 12 matching lines...) Expand all Loading... |
79 // different services for different apps for better isolation. | 79 // different services for different apps for better isolation. |
80 RegisterFrameMojoShellServices(service_registry_.get(), frame_host_); | 80 RegisterFrameMojoShellServices(service_registry_.get(), frame_host_); |
81 GetContentClient()->browser()->RegisterFrameMojoShellServices( | 81 GetContentClient()->browser()->RegisterFrameMojoShellServices( |
82 service_registry_.get(), frame_host_); | 82 service_registry_.get(), frame_host_); |
83 } | 83 } |
84 | 84 |
85 return service_registry_.get(); | 85 return service_registry_.get(); |
86 } | 86 } |
87 | 87 |
88 } // namespace content | 88 } // namespace content |
OLD | NEW |