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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 URLResponsePtr response, | 46 URLResponsePtr response, |
47 Setup* setup) | 47 Setup* setup) |
48 : url_(response->url), | 48 : url_(response->url), |
49 binding_(this, request.Pass()), | 49 binding_(this, request.Pass()), |
50 initial_response_(response.Pass()), | 50 initial_response_(response.Pass()), |
51 setup_(setup) {} | 51 setup_(setup) {} |
52 | 52 |
53 void Initialize(ShellPtr shell, const String& url) override { | 53 void Initialize(ShellPtr shell, const String& url) override { |
54 ServiceProviderPtr service_provider; | 54 ServiceProviderPtr service_provider; |
55 shell_ = shell.Pass(); | 55 shell_ = shell.Pass(); |
56 shell_->ConnectToApplication("mojo:network_service", | 56 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 57 request->url = mojo::String::From("mojo:network_service"); |
| 58 shell_->ConnectToApplication(request.Pass(), |
57 GetProxy(&service_provider), nullptr); | 59 GetProxy(&service_provider), nullptr); |
58 ConnectToService(service_provider.get(), &network_service_); | 60 ConnectToService(service_provider.get(), &network_service_); |
59 } | 61 } |
60 | 62 |
61 void AcceptConnection(const String& requestor_url, | 63 void AcceptConnection(const String& requestor_url, |
62 InterfaceRequest<ServiceProvider> services, | 64 InterfaceRequest<ServiceProvider> services, |
63 ServiceProviderPtr exposed_services, | 65 ServiceProviderPtr exposed_services, |
64 const String& url) override { | 66 const String& url) override { |
65 if (initial_response_) { | 67 if (initial_response_) { |
66 OnResponseReceived(URLLoaderPtr(), services.Pass(), | 68 OnResponseReceived(URLLoaderPtr(), services.Pass(), |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 159 |
158 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); | 160 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); |
159 }; | 161 }; |
160 | 162 |
161 } // namespace html_viewer | 163 } // namespace html_viewer |
162 | 164 |
163 MojoResult MojoMain(MojoHandle shell_handle) { | 165 MojoResult MojoMain(MojoHandle shell_handle) { |
164 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer); | 166 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer); |
165 return runner.Run(shell_handle); | 167 return runner.Run(shell_handle); |
166 } | 168 } |
OLD | NEW |