OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/i18n/icu_util.h" |
| 6 #include "mojo/application/application_runner_chromium.h" |
| 7 #include "mojo/apps/js/application_delegate_impl.h" |
| 8 #include "mojo/public/c/system/main.h" |
| 9 #include "mojo/public/cpp/application/application_impl.h" |
| 10 #include "mojo/public/cpp/application/interface_factory_impl.h" |
| 11 #include "mojo/services/public/interfaces/content_handler/content_handler.mojom.
h" |
| 12 |
| 13 namespace mojo { |
| 14 namespace apps { |
| 15 |
| 16 class ContentHandlerApplicationDelegateImpl : public ApplicationDelegateImpl { |
| 17 public: |
| 18 ContentHandlerApplicationDelegateImpl() : content_handler_factory_(this) { |
| 19 } |
| 20 |
| 21 private: |
| 22 virtual bool ConfigureIncomingConnection( |
| 23 ApplicationConnection* connection) override { |
| 24 connection->AddService(&content_handler_factory_); |
| 25 return true; |
| 26 } |
| 27 |
| 28 InterfaceFactoryImplWithContext<ContentHandlerImpl, ApplicationDelegateImpl> |
| 29 content_handler_factory_; |
| 30 }; |
| 31 |
| 32 } // namespace apps |
| 33 } // namespace mojo |
| 34 |
| 35 MojoResult MojoMain(MojoHandle shell_handle) { |
| 36 base::i18n::InitializeICU(); |
| 37 mojo::ApplicationRunnerChromium runner( |
| 38 new mojo::apps::ContentHandlerApplicationDelegateImpl()); |
| 39 return runner.Run(shell_handle); |
| 40 } |
OLD | NEW |