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