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 "mojo/shell/shell_impl.h" | 5 #include "mojo/shell/shell_impl.h" |
6 | 6 |
7 #include "mojo/application/public/interfaces/content_handler.mojom.h" | 7 #include "mojo/application/public/interfaces/content_handler.mojom.h" |
8 #include "mojo/common/common_type_converters.h" | 8 #include "mojo/common/common_type_converters.h" |
9 #include "mojo/common/url_type_converters.h" | 9 #include "mojo/common/url_type_converters.h" |
10 #include "mojo/shell/application_manager.h" | 10 #include "mojo/shell/application_manager.h" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 | 35 |
36 void ShellImpl::ConnectToClient(const GURL& requested_url, | 36 void ShellImpl::ConnectToClient(const GURL& requested_url, |
37 const GURL& requestor_url, | 37 const GURL& requestor_url, |
38 InterfaceRequest<ServiceProvider> services, | 38 InterfaceRequest<ServiceProvider> services, |
39 ServiceProviderPtr exposed_services) { | 39 ServiceProviderPtr exposed_services) { |
40 application_->AcceptConnection(String::From(requestor_url), services.Pass(), | 40 application_->AcceptConnection(String::From(requestor_url), services.Pass(), |
41 exposed_services.Pass(), requested_url.spec()); | 41 exposed_services.Pass(), requested_url.spec()); |
42 } | 42 } |
43 | 43 |
44 // Shell implementation: | 44 // Shell implementation: |
45 void ShellImpl::ConnectToApplication(const String& app_url, | 45 void ShellImpl::ConnectToApplication(mojo::URLRequestPtr app_url, |
Ben Goodger (Google)
2015/05/20 21:17:05
nit: app_request
jam
2015/05/21 00:41:09
Done.
| |
46 InterfaceRequest<ServiceProvider> services, | 46 InterfaceRequest<ServiceProvider> services, |
47 ServiceProviderPtr exposed_services) { | 47 ServiceProviderPtr exposed_services) { |
48 GURL app_gurl(app_url); | 48 GURL app_gurl(app_url->url.To<std::string>()); |
49 if (!app_gurl.is_valid()) { | 49 if (!app_gurl.is_valid()) { |
50 LOG(ERROR) << "Error: invalid URL: " << app_url; | 50 LOG(ERROR) << "Error: invalid URL: " << app_url; |
51 return; | 51 return; |
52 } | 52 } |
53 manager_->ConnectToApplication(app_gurl, identity_.url, services.Pass(), | 53 manager_->ConnectToApplication(app_url.Pass(), identity_.url, |
54 exposed_services.Pass(), base::Closure()); | 54 services.Pass(), exposed_services.Pass(), |
55 base::Closure()); | |
55 } | 56 } |
56 | 57 |
57 void ShellImpl::OnConnectionError() { | 58 void ShellImpl::OnConnectionError() { |
58 manager_->OnShellImplError(this); | 59 manager_->OnShellImplError(this); |
59 } | 60 } |
60 | 61 |
61 } // namespace shell | 62 } // namespace shell |
62 } // namespace mojo | 63 } // namespace mojo |
OLD | NEW |