| 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> |
| 8 |
| 7 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 8 #include "content/browser/mojo/mojo_shell_context.h" | 10 #include "content/browser/mojo/mojo_shell_context.h" |
| 9 #include "content/common/mojo/service_registry_impl.h" | 11 #include "content/common/mojo/service_registry_impl.h" |
| 10 #include "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
| 11 #include "content/public/browser/render_frame_host.h" | 13 #include "content/public/browser/render_frame_host.h" |
| 12 #include "content/public/browser/site_instance.h" | 14 #include "content/public/browser/site_instance.h" |
| 13 #include "content/public/common/content_client.h" | 15 #include "content/public/common/content_client.h" |
| 14 | 16 |
| 15 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_MEDIA) | 17 #if defined(OS_ANDROID) && defined(ENABLE_MOJO_MEDIA) |
| 16 #include "content/browser/media/android/provision_fetcher_impl.h" | 18 #include "content/browser/media/android/provision_fetcher_impl.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 mojo::ServiceProviderPtr frame_services; | 56 mojo::ServiceProviderPtr frame_services; |
| 55 service_provider_bindings_.AddBinding(GetServiceRegistry(), | 57 service_provider_bindings_.AddBinding(GetServiceRegistry(), |
| 56 GetProxy(&frame_services)); | 58 GetProxy(&frame_services)); |
| 57 | 59 |
| 58 mojo::shell::CapabilityFilter capability_filter = | 60 mojo::shell::CapabilityFilter capability_filter = |
| 59 mojo::shell::GetPermissiveCapabilityFilter(); | 61 mojo::shell::GetPermissiveCapabilityFilter(); |
| 60 if (!filter.is_null()) | 62 if (!filter.is_null()) |
| 61 capability_filter = filter->filter.To<mojo::shell::CapabilityFilter>(); | 63 capability_filter = filter->filter.To<mojo::shell::CapabilityFilter>(); |
| 62 MojoShellContext::ConnectToApplication( | 64 MojoShellContext::ConnectToApplication( |
| 63 GURL(application_url->url), frame_host_->GetSiteInstance()->GetSiteURL(), | 65 GURL(application_url->url), frame_host_->GetSiteInstance()->GetSiteURL(), |
| 64 services.Pass(), frame_services.Pass(), capability_filter, callback); | 66 std::move(services), std::move(frame_services), capability_filter, |
| 67 callback); |
| 65 } | 68 } |
| 66 | 69 |
| 67 void FrameMojoShell::QuitApplication() { | 70 void FrameMojoShell::QuitApplication() { |
| 68 } | 71 } |
| 69 | 72 |
| 70 ServiceRegistryImpl* FrameMojoShell::GetServiceRegistry() { | 73 ServiceRegistryImpl* FrameMojoShell::GetServiceRegistry() { |
| 71 if (!service_registry_) { | 74 if (!service_registry_) { |
| 72 service_registry_.reset(new ServiceRegistryImpl()); | 75 service_registry_.reset(new ServiceRegistryImpl()); |
| 73 | 76 |
| 74 // TODO(rockot/xhwang): Currently all applications connected share the same | 77 // TODO(rockot/xhwang): Currently all applications connected share the same |
| 75 // 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 |
| 76 // different services for different apps for better isolation. | 79 // different services for different apps for better isolation. |
| 77 RegisterFrameMojoShellServices(service_registry_.get(), frame_host_); | 80 RegisterFrameMojoShellServices(service_registry_.get(), frame_host_); |
| 78 GetContentClient()->browser()->RegisterFrameMojoShellServices( | 81 GetContentClient()->browser()->RegisterFrameMojoShellServices( |
| 79 service_registry_.get(), frame_host_); | 82 service_registry_.get(), frame_host_); |
| 80 } | 83 } |
| 81 | 84 |
| 82 return service_registry_.get(); | 85 return service_registry_.get(); |
| 83 } | 86 } |
| 84 | 87 |
| 85 } // namespace content | 88 } // namespace content |
| OLD | NEW |