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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 const String& url) override { | 80 const String& url) override { |
81 ServiceProviderPtr service_provider; | 81 ServiceProviderPtr service_provider; |
82 shell_ = shell.Pass(); | 82 shell_ = shell.Pass(); |
83 shell_->ConnectToApplication("mojo:network_service", | 83 shell_->ConnectToApplication("mojo:network_service", |
84 GetProxy(&service_provider), nullptr); | 84 GetProxy(&service_provider), nullptr); |
85 ConnectToService(service_provider.get(), &network_service_); | 85 ConnectToService(service_provider.get(), &network_service_); |
86 } | 86 } |
87 | 87 |
88 void AcceptConnection(const String& requestor_url, | 88 void AcceptConnection(const String& requestor_url, |
89 InterfaceRequest<ServiceProvider> services, | 89 InterfaceRequest<ServiceProvider> services, |
90 ServiceProviderPtr exposed_services) override { | 90 ServiceProviderPtr exposed_services, |
| 91 const String& url) override { |
91 if (initial_response_) { | 92 if (initial_response_) { |
92 OnResponseReceived(URLLoaderPtr(), services.Pass(), | 93 OnResponseReceived(URLLoaderPtr(), services.Pass(), |
93 initial_response_.Pass()); | 94 initial_response_.Pass()); |
94 } else { | 95 } else { |
95 URLLoaderPtr loader; | 96 URLLoaderPtr loader; |
96 network_service_->CreateURLLoader(GetProxy(&loader)); | 97 network_service_->CreateURLLoader(GetProxy(&loader)); |
97 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 98 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
98 request->url = url_; | 99 request->url = url_; |
99 request->auto_follow_redirects = true; | 100 request->auto_follow_redirects = true; |
100 | 101 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 234 |
234 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); | 235 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); |
235 }; | 236 }; |
236 | 237 |
237 } // namespace html_viewer | 238 } // namespace html_viewer |
238 | 239 |
239 MojoResult MojoMain(MojoHandle shell_handle) { | 240 MojoResult MojoMain(MojoHandle shell_handle) { |
240 mojo::ApplicationRunnerChromium runner(new html_viewer::HTMLViewer); | 241 mojo::ApplicationRunnerChromium runner(new html_viewer::HTMLViewer); |
241 return runner.Run(shell_handle); | 242 return runner.Run(shell_handle); |
242 } | 243 } |
OLD | NEW |