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
3 // found in the LICENSE file.
5 #include "content/browser/mojo/mojo_app_connection_impl.h"
7 #include "content/browser/mojo/mojo_shell_context.h"
8 #include "mojo/shell/capability_filter.h"
12 const char kBrowserMojoAppUrl
[] = "system:content_browser";
15 scoped_ptr
<MojoAppConnection
> MojoAppConnection::Create(
17 const GURL
& requestor_url
) {
18 return scoped_ptr
<MojoAppConnection
>(
19 new MojoAppConnectionImpl(url
, requestor_url
));
22 MojoAppConnectionImpl::MojoAppConnectionImpl(const GURL
& url
,
23 const GURL
& requestor_url
) {
24 MojoShellContext::ConnectToApplication(
25 url
, requestor_url
, mojo::GetProxy(&services_
),
26 mojo::ServiceProviderPtr(), mojo::shell::GetPermissiveCapabilityFilter());
29 MojoAppConnectionImpl::~MojoAppConnectionImpl() {
32 void MojoAppConnectionImpl::ConnectToService(
33 const std::string
& service_name
,
34 mojo::ScopedMessagePipeHandle handle
) {
35 services_
->ConnectToService(service_name
, handle
.Pass());
38 } // namespace content