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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class HTMLViewerApplication : public mojo::Application { | 43 class HTMLViewerApplication : public mojo::Application { |
44 public: | 44 public: |
45 HTMLViewerApplication(InterfaceRequest<Application> request, | 45 HTMLViewerApplication(InterfaceRequest<Application> request, |
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, | 53 void Initialize(ShellPtr shell, const String& url) override { |
54 Array<String> args, | |
55 const String& url) override { | |
56 ServiceProviderPtr service_provider; | 54 ServiceProviderPtr service_provider; |
57 shell_ = shell.Pass(); | 55 shell_ = shell.Pass(); |
58 shell_->ConnectToApplication("mojo:network_service", | 56 shell_->ConnectToApplication("mojo:network_service", |
59 GetProxy(&service_provider), nullptr); | 57 GetProxy(&service_provider), nullptr); |
60 ConnectToService(service_provider.get(), &network_service_); | 58 ConnectToService(service_provider.get(), &network_service_); |
61 } | 59 } |
62 | 60 |
63 void AcceptConnection(const String& requestor_url, | 61 void AcceptConnection(const String& requestor_url, |
64 InterfaceRequest<ServiceProvider> services, | 62 InterfaceRequest<ServiceProvider> services, |
65 ServiceProviderPtr exposed_services, | 63 ServiceProviderPtr exposed_services, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 157 |
160 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); | 158 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); |
161 }; | 159 }; |
162 | 160 |
163 } // namespace html_viewer | 161 } // namespace html_viewer |
164 | 162 |
165 MojoResult MojoMain(MojoHandle shell_handle) { | 163 MojoResult MojoMain(MojoHandle shell_handle) { |
166 mojo::ApplicationRunnerChromium runner(new html_viewer::HTMLViewer); | 164 mojo::ApplicationRunnerChromium runner(new html_viewer::HTMLViewer); |
167 return runner.Run(shell_handle); | 165 return runner.Run(shell_handle); |
168 } | 166 } |
OLD | NEW |