Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / browser / mojo / mojo_app_connection_impl.cc
blobca8d5a5f82415c35a3be734dc78bd235050d8e31
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 "base/bind.h"
8 #include "content/browser/mojo/mojo_shell_context.h"
9 #include "mojo/shell/capability_filter.h"
11 namespace content {
13 const char kBrowserMojoAppUrl[] = "system:content_browser";
15 namespace {
16 void OnGotContentHandlerID(uint32_t content_handler_id) {}
17 } // namespace
19 // static
20 scoped_ptr<MojoAppConnection> MojoAppConnection::Create(
21 const GURL& url,
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