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"
8 #include "content/browser/mojo/mojo_shell_context.h"
9 #include "mojo/shell/capability_filter.h"
13 const char kBrowserMojoAppUrl
[] = "system:content_browser";
16 void OnGotContentHandlerID(uint32_t content_handler_id
) {}
20 scoped_ptr
<MojoAppConnection
> MojoAppConnection::Create(
22 const GURL
& requestor_url
) {
23 return scoped_ptr
<MojoAppConnection
>(
24 new MojoAppConnectionImpl(url
, requestor_url
));
27 MojoAppConnectionImpl::MojoAppConnectionImpl(const GURL
& url
,
28 const GURL
& requestor_url
) {
29 MojoShellContext::ConnectToApplication(
30 url
, requestor_url
, mojo::GetProxy(&services_
),
31 mojo::ServiceProviderPtr(), mojo::shell::GetPermissiveCapabilityFilter(),
32 base::Bind(&OnGotContentHandlerID
));
35 MojoAppConnectionImpl::~MojoAppConnectionImpl() {
38 void MojoAppConnectionImpl::ConnectToService(
39 const std::string
& service_name
,
40 mojo::ScopedMessagePipeHandle handle
) {
41 services_
->ConnectToService(service_name
, handle
.Pass());
44 } // namespace content