| 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 "shell/application_manager/shell_impl.h" | 5 #include "shell/application_manager/shell_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "mojo/converters/url/url_type_converters.h" | 9 #include "mojo/converters/url/url_type_converters.h" |
| 10 #include "mojo/services/content_handler/interfaces/content_handler.mojom.h" | 10 #include "mojo/services/content_handler/interfaces/content_handler.mojom.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // ShellImpl::ApplicationConnectorImpl ----------------------------------------- | 26 // ShellImpl::ApplicationConnectorImpl ----------------------------------------- |
| 27 | 27 |
| 28 ShellImpl::ApplicationConnectorImpl::ApplicationConnectorImpl(Shell* shell) | 28 ShellImpl::ApplicationConnectorImpl::ApplicationConnectorImpl(Shell* shell) |
| 29 : shell_(shell) {} | 29 : shell_(shell) {} |
| 30 | 30 |
| 31 ShellImpl::ApplicationConnectorImpl::~ApplicationConnectorImpl() {} | 31 ShellImpl::ApplicationConnectorImpl::~ApplicationConnectorImpl() {} |
| 32 | 32 |
| 33 void ShellImpl::ApplicationConnectorImpl::ConnectToApplication( | 33 void ShellImpl::ApplicationConnectorImpl::ConnectToApplication( |
| 34 const String& app_url, | 34 const String& app_url, |
| 35 InterfaceRequest<ServiceProvider> services, | 35 InterfaceRequest<ServiceProvider> services) { |
| 36 InterfaceHandle<mojo::ServiceProvider> exposed_services) { | 36 shell_->ConnectToApplication(app_url, std::move(services)); |
| 37 shell_->ConnectToApplication(app_url, std::move(services), | |
| 38 std::move(exposed_services)); | |
| 39 } | 37 } |
| 40 | 38 |
| 41 void ShellImpl::ApplicationConnectorImpl::Duplicate( | 39 void ShellImpl::ApplicationConnectorImpl::Duplicate( |
| 42 InterfaceRequest<ApplicationConnector> application_connector_request) { | 40 InterfaceRequest<ApplicationConnector> application_connector_request) { |
| 43 bindings_.AddBinding(this, std::move(application_connector_request)); | 41 bindings_.AddBinding(this, std::move(application_connector_request)); |
| 44 } | 42 } |
| 45 | 43 |
| 46 // ShellImpl ------------------------------------------------------------------- | 44 // ShellImpl ------------------------------------------------------------------- |
| 47 | 45 |
| 48 ShellImpl::ShellImpl(ApplicationPtr application, | 46 ShellImpl::ShellImpl(ApplicationPtr application, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 66 ShellPtr shell; | 64 ShellPtr shell; |
| 67 binding_.Bind(GetProxy(&shell)); | 65 binding_.Bind(GetProxy(&shell)); |
| 68 application_->Initialize(std::move(shell), std::move(args), | 66 application_->Initialize(std::move(shell), std::move(args), |
| 69 identity_.url.spec()); | 67 identity_.url.spec()); |
| 70 } | 68 } |
| 71 | 69 |
| 72 void ShellImpl::ConnectToClient(const GURL& requested_url, | 70 void ShellImpl::ConnectToClient(const GURL& requested_url, |
| 73 const GURL& requestor_url, | 71 const GURL& requestor_url, |
| 74 InterfaceRequest<ServiceProvider> services) { | 72 InterfaceRequest<ServiceProvider> services) { |
| 75 application_->AcceptConnection(String::From(requestor_url), | 73 application_->AcceptConnection(String::From(requestor_url), |
| 76 std::move(services), nullptr, | 74 requested_url.spec(), std::move(services)); |
| 77 requested_url.spec()); | |
| 78 } | 75 } |
| 79 | 76 |
| 80 void ShellImpl::ConnectToApplication( | 77 void ShellImpl::ConnectToApplication( |
| 81 const String& app_url, | 78 const String& app_url, |
| 82 InterfaceRequest<ServiceProvider> services, | 79 InterfaceRequest<ServiceProvider> services) { |
| 83 InterfaceHandle<mojo::ServiceProvider> exposed_services) { | |
| 84 GURL app_gurl(app_url); | 80 GURL app_gurl(app_url); |
| 85 if (!app_gurl.is_valid()) { | 81 if (!app_gurl.is_valid()) { |
| 86 LOG(ERROR) << "Error: invalid URL: " << app_url; | 82 LOG(ERROR) << "Error: invalid URL: " << app_url; |
| 87 return; | 83 return; |
| 88 } | 84 } |
| 89 LOG_IF(ERROR, exposed_services) << "exposed_services no longer supported!"; | |
| 90 manager_->ConnectToApplication(app_gurl, identity_.url, std::move(services), | 85 manager_->ConnectToApplication(app_gurl, identity_.url, std::move(services), |
| 91 base::Closure()); | 86 base::Closure()); |
| 92 } | 87 } |
| 93 | 88 |
| 94 void ShellImpl::CreateApplicationConnector( | 89 void ShellImpl::CreateApplicationConnector( |
| 95 InterfaceRequest<ApplicationConnector> application_connector_request) { | 90 InterfaceRequest<ApplicationConnector> application_connector_request) { |
| 96 application_connector_impl_.Duplicate( | 91 application_connector_impl_.Duplicate( |
| 97 std::move(application_connector_request)); | 92 std::move(application_connector_request)); |
| 98 } | 93 } |
| 99 | 94 |
| 100 } // namespace shell | 95 } // namespace shell |
| OLD | NEW |