| 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/mojo/mojo_app_connection_impl.h" | 5 #include "content/browser/mojo/mojo_app_connection_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/mojo/mojo_shell_context.h" | 7 #include "content/browser/mojo/mojo_shell_context.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 const char kBrowserMojoAppUrl[] = "system:content_browser"; | 11 const char kBrowserMojoAppUrl[] = "system:content_browser"; |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 scoped_ptr<MojoAppConnection> MojoAppConnection::Create( | 14 scoped_ptr<MojoAppConnection> MojoAppConnection::Create( |
| 15 const GURL& url, | 15 const GURL& url, |
| 16 const GURL& requestor_url) { | 16 const GURL& requestor_url) { |
| 17 return scoped_ptr<MojoAppConnection>( | 17 return scoped_ptr<MojoAppConnection>( |
| 18 new MojoAppConnectionImpl(url, requestor_url)); | 18 new MojoAppConnectionImpl(url, requestor_url)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 MojoAppConnectionImpl::MojoAppConnectionImpl(const GURL& url, | 21 MojoAppConnectionImpl::MojoAppConnectionImpl(const GURL& url, |
| 22 const GURL& requestor_url) { | 22 const GURL& requestor_url) { |
| 23 MojoShellContext::ConnectToApplication(url, requestor_url, | 23 MojoShellContext::ConnectToApplication(url, requestor_url, |
| 24 mojo::GetProxy(&services_), | 24 mojo::GetProxy(&services_), |
| 25 mojo::ServiceProviderPtr()); | 25 mojo::ServiceProviderPtr(), |
| 26 nullptr); |
| 26 } | 27 } |
| 27 | 28 |
| 28 MojoAppConnectionImpl::~MojoAppConnectionImpl() { | 29 MojoAppConnectionImpl::~MojoAppConnectionImpl() { |
| 29 } | 30 } |
| 30 | 31 |
| 31 void MojoAppConnectionImpl::ConnectToService( | 32 void MojoAppConnectionImpl::ConnectToService( |
| 32 const std::string& service_name, | 33 const std::string& service_name, |
| 33 mojo::ScopedMessagePipeHandle handle) { | 34 mojo::ScopedMessagePipeHandle handle) { |
| 34 services_->ConnectToService(service_name, handle.Pass()); | 35 services_->ConnectToService(service_name, handle.Pass()); |
| 35 } | 36 } |
| 36 | 37 |
| 37 } // namespace content | 38 } // namespace content |
| OLD | NEW |