Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: mojo/apps/js/content_handler_main.cc

Issue 608333002: Standalone Mojo Javascript application (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the GN build Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
6 #include "base/i18n/icu_util.h"
7 #include "mojo/application/application_runner_chromium.h"
8 #include "mojo/apps/js/application_delegate_impl.h"
9 #include "mojo/apps/js/content_handler_impl.h"
10 #include "mojo/public/c/system/main.h"
11 #include "mojo/public/cpp/application/application_impl.h"
12 #include "mojo/public/cpp/application/interface_factory_impl.h"
13 #include "mojo/services/public/interfaces/content_handler/content_handler.mojom. h"
14
15 namespace mojo {
16 namespace apps {
17
18 class ContentHandlerApplicationDelegateImpl : public ApplicationDelegateImpl {
19 public:
20 ContentHandlerApplicationDelegateImpl() : content_handler_factory_(this) {
21 }
22
23 private:
24 virtual bool ConfigureIncomingConnection(
25 ApplicationConnection* connection) override {
26 connection->AddService(&content_handler_factory_);
27 return true;
28 }
29
30 InterfaceFactoryImplWithContext<ContentHandlerImpl, ApplicationDelegateImpl>
31 content_handler_factory_;
32 };
33
34 } // namespace apps
35 } // namespace mojo
36
37 MojoResult MojoMain(MojoHandle shell_handle) {
38 base::i18n::InitializeICU();
39 mojo::ApplicationRunnerChromium runner(
40 new mojo::apps::ContentHandlerApplicationDelegateImpl());
41 return runner.Run(shell_handle);
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698