| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const ConnectToApplicationCallback& callback) { | 55 const ConnectToApplicationCallback& callback) { |
| 56 mojo::ServiceProviderPtr frame_services; | 56 mojo::ServiceProviderPtr 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), frame_host_->GetSiteInstance()->GetSiteURL(), | 65 GURL(application_url->url.get()), |
| 66 std::move(services), std::move(frame_services), capability_filter, | 66 frame_host_->GetSiteInstance()->GetSiteURL(), std::move(services), |
| 67 callback); | 67 std::move(frame_services), capability_filter, callback); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void FrameMojoShell::QuitApplication() { | 70 void FrameMojoShell::QuitApplication() { |
| 71 } | 71 } |
| 72 | 72 |
| 73 ServiceRegistryImpl* FrameMojoShell::GetServiceRegistry() { | 73 ServiceRegistryImpl* FrameMojoShell::GetServiceRegistry() { |
| 74 if (!service_registry_) { | 74 if (!service_registry_) { |
| 75 service_registry_.reset(new ServiceRegistryImpl()); | 75 service_registry_.reset(new ServiceRegistryImpl()); |
| 76 | 76 |
| 77 // TODO(rockot/xhwang): Currently all applications connected share the same | 77 // TODO(rockot/xhwang): Currently all applications connected share the same |
| 78 // set of services registered in the |registry|. We may want to provide | 78 // set of services registered in the |registry|. We may want to provide |
| 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 |