| 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 "mojo/application/application_runner_chromium.h" | 5 #include "mojo/application/application_runner_chromium.h" |
| 6 #include "mojo/application/content_handler_factory.h" | 6 #include "mojo/application/content_handler_factory.h" |
| 7 #include "mojo/dart/embedder/dart_controller.h" | 7 #include "mojo/dart/embedder/dart_controller.h" |
| 8 #include "mojo/icu/icu.h" | 8 #include "mojo/icu/icu.h" |
| 9 #include "mojo/public/c/system/main.h" | 9 #include "mojo/public/c/system/main.h" |
| 10 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // Overridden from ApplicationDelegate: | 36 // Overridden from ApplicationDelegate: |
| 37 bool ConfigureIncomingConnection( | 37 bool ConfigureIncomingConnection( |
| 38 mojo::ApplicationConnection* connection) override { | 38 mojo::ApplicationConnection* connection) override { |
| 39 connection->AddService(&content_handler_factory_); | 39 connection->AddService(&content_handler_factory_); |
| 40 return true; | 40 return true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Overridden from ContentHandlerFactory::ManagedDelegate: | 43 // Overridden from ContentHandlerFactory::ManagedDelegate: |
| 44 scoped_ptr<mojo::ContentHandlerFactory::HandledApplicationHolder> | 44 scoped_ptr<mojo::ContentHandlerFactory::HandledApplicationHolder> |
| 45 CreateApplication(mojo::ShellPtr shell, | 45 CreateApplication( |
| 46 mojo::URLResponsePtr response) override { | 46 mojo::InterfaceRequest<mojo::Application> application_request, |
| 47 return make_scoped_ptr(new DartApp(shell.Pass(), response.Pass())); | 47 mojo::URLResponsePtr response) override { |
| 48 return make_scoped_ptr( |
| 49 new DartApp(application_request.Pass(), response.Pass())); |
| 48 } | 50 } |
| 49 | 51 |
| 50 mojo::ContentHandlerFactory content_handler_factory_; | 52 mojo::ContentHandlerFactory content_handler_factory_; |
| 51 | 53 |
| 52 DISALLOW_COPY_AND_ASSIGN(DartContentHandler); | 54 DISALLOW_COPY_AND_ASSIGN(DartContentHandler); |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 } // namespace dart | 57 } // namespace dart |
| 56 | 58 |
| 57 MojoResult MojoMain(MojoHandle shell_handle) { | 59 MojoResult MojoMain(MojoHandle shell_handle) { |
| 58 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandler); | 60 mojo::ApplicationRunnerChromium runner(new dart::DartContentHandler); |
| 59 return runner.Run(shell_handle); | 61 return runner.Run(shell_handle); |
| 60 } | 62 } |
| OLD | NEW |