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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 private: | 203 private: |
204 // Overridden from ApplicationDelegate: | 204 // Overridden from ApplicationDelegate: |
205 virtual bool ConfigureIncomingConnection( | 205 virtual bool ConfigureIncomingConnection( |
206 ApplicationConnection* connection) override { | 206 ApplicationConnection* connection) override { |
207 connection->AddService(&content_handler_factory_); | 207 connection->AddService(&content_handler_factory_); |
208 return true; | 208 return true; |
209 } | 209 } |
210 | 210 |
211 // Overridden from ContentHandlerFactory::ManagedDelegate: | 211 // Overridden from ContentHandlerFactory::ManagedDelegate: |
212 virtual scoped_ptr<ContentHandlerFactory::HandledApplicationHolder> | 212 virtual scoped_ptr<ContentHandlerFactory::HandledApplicationHolder> |
213 CreateApplication(ShellPtr shell, URLResponsePtr response) override { | 213 CreateApplication(InterfaceRequest<Application> application_request, |
214 return make_handled_factory_holder( | 214 URLResponsePtr response) override { |
215 new mojo::ApplicationImpl(new PNGView(response.Pass()), shell.Pass())); | 215 return make_handled_factory_holder(new mojo::ApplicationImpl( |
| 216 new PNGView(response.Pass()), application_request.Pass())); |
216 } | 217 } |
217 | 218 |
218 ContentHandlerFactory content_handler_factory_; | 219 ContentHandlerFactory content_handler_factory_; |
219 | 220 |
220 DISALLOW_COPY_AND_ASSIGN(PNGViewer); | 221 DISALLOW_COPY_AND_ASSIGN(PNGViewer); |
221 }; | 222 }; |
222 | 223 |
223 } // namespace examples | 224 } // namespace examples |
224 } // namespace mojo | 225 } // namespace mojo |
225 | 226 |
226 MojoResult MojoMain(MojoHandle shell_handle) { | 227 MojoResult MojoMain(MojoHandle shell_handle) { |
227 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer()); | 228 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer()); |
228 return runner.Run(shell_handle); | 229 return runner.Run(shell_handle); |
229 } | 230 } |
OLD | NEW |