| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/shell/application_manager.h" | 5 #include "mojo/shell/application_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 STLDeleteValues(&url_to_loader_); | 66 STLDeleteValues(&url_to_loader_); |
| 67 STLDeleteValues(&scheme_to_loader_); | 67 STLDeleteValues(&scheme_to_loader_); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void ApplicationManager::TerminateShellConnections() { | 70 void ApplicationManager::TerminateShellConnections() { |
| 71 STLDeleteValues(&identity_to_instance_); | 71 STLDeleteValues(&identity_to_instance_); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ApplicationManager::ConnectToApplication( | 74 void ApplicationManager::ConnectToApplication( |
| 75 ApplicationInstance* originator, | 75 ApplicationInstance* originator, |
| 76 URLRequestPtr requested_url, | 76 URLRequestPtr app_url_request, |
| 77 const std::string& qualifier, | 77 const std::string& qualifier, |
| 78 const GURL& requestor_url, | |
| 79 InterfaceRequest<ServiceProvider> services, | 78 InterfaceRequest<ServiceProvider> services, |
| 80 ServiceProviderPtr exposed_services, | 79 ServiceProviderPtr exposed_services, |
| 81 const CapabilityFilter& capability_filter, | 80 const CapabilityFilter& filter, |
| 82 const base::Closure& on_application_end, | 81 const base::Closure& on_application_end, |
| 83 const Shell::ConnectToApplicationCallback& connect_callback) { | 82 const Shell::ConnectToApplicationCallback& connect_callback) { |
| 84 DCHECK(requestor_url.is_empty()); | |
| 85 scoped_ptr<ConnectToApplicationParams> params(new ConnectToApplicationParams); | 83 scoped_ptr<ConnectToApplicationParams> params(new ConnectToApplicationParams); |
| 86 params->SetOriginatorInfo(originator); | 84 params->SetOriginatorInfo(originator); |
| 87 params->SetURLInfo(requested_url.Pass()); | 85 params->SetURLInfo(app_url_request.Pass()); |
| 88 params->set_qualifier(qualifier); | 86 params->set_qualifier(qualifier); |
| 89 params->set_services(services.Pass()); | 87 params->set_services(services.Pass()); |
| 90 params->set_exposed_services(exposed_services.Pass()); | 88 params->set_exposed_services(exposed_services.Pass()); |
| 91 params->set_filter(capability_filter); | 89 params->set_filter(filter); |
| 92 params->set_on_application_end(on_application_end); | 90 params->set_on_application_end(on_application_end); |
| 93 params->set_connect_callback(connect_callback); | 91 params->set_connect_callback(connect_callback); |
| 94 | 92 |
| 95 ConnectToApplication(params.Pass()); | 93 ConnectToApplication(params.Pass()); |
| 96 } | 94 } |
| 97 | 95 |
| 98 void ApplicationManager::ConnectToApplication( | 96 void ApplicationManager::ConnectToApplication( |
| 99 scoped_ptr<ConnectToApplicationParams> params) { | 97 scoped_ptr<ConnectToApplicationParams> params) { |
| 100 GURL original_url = params->app_url(); | 98 GURL original_url = params->app_url(); |
| 101 URLRequestPtr original_url_request = params->TakeAppURLRequest(); | 99 URLRequestPtr original_url_request = params->TakeAppURLRequest(); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 services->ConnectToService(interface_name, pipe.handle1.Pass()); | 546 services->ConnectToService(interface_name, pipe.handle1.Pass()); |
| 549 return pipe.handle0.Pass(); | 547 return pipe.handle0.Pass(); |
| 550 } | 548 } |
| 551 | 549 |
| 552 Shell::ConnectToApplicationCallback EmptyConnectCallback() { | 550 Shell::ConnectToApplicationCallback EmptyConnectCallback() { |
| 553 return base::Bind(&OnEmptyOnConnectCallback); | 551 return base::Bind(&OnEmptyOnConnectCallback); |
| 554 } | 552 } |
| 555 | 553 |
| 556 } // namespace shell | 554 } // namespace shell |
| 557 } // namespace mojo | 555 } // namespace mojo |
| OLD | NEW |