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/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
8 #include "mojo/application/application_runner_chromium.h" | 8 #include "mojo/application/application_runner_chromium.h" |
9 #include "mojo/common/tracing_impl.h" | 9 #include "mojo/common/tracing_impl.h" |
10 #include "mojo/public/c/system/main.h" | 10 #include "mojo/public/c/system/main.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 if (app->HasArg(kTesting)) { | 42 if (app->HasArg(kTesting)) { |
43 DisplayDelegate::setDisplayDelegateCreateFunction( | 43 DisplayDelegate::setDisplayDelegateCreateFunction( |
44 DisplayDelegateBitmap::create); | 44 DisplayDelegateBitmap::create); |
45 } else { | 45 } else { |
46 DisplayDelegate::setDisplayDelegateCreateFunction( | 46 DisplayDelegate::setDisplayDelegateCreateFunction( |
47 DisplayDelegateGanesh::create); | 47 DisplayDelegateGanesh::create); |
48 } | 48 } |
49 | 49 |
50 platform_impl_.reset(new PlatformImpl(app)); | 50 platform_impl_.reset(new PlatformImpl(app)); |
51 blink::initialize(platform_impl_.get()); | 51 blink::initialize(platform_impl_.get()); |
| 52 |
| 53 // TODO(eseidel): Haven't solved ICU data loading for MojoShell.apk yet. |
| 54 #if !defined(OS_ANDROID) |
52 base::i18n::InitializeICU(); | 55 base::i18n::InitializeICU(); |
| 56 #endif |
53 | 57 |
54 mojo::TracingImpl::Create(app); | 58 mojo::TracingImpl::Create(app); |
55 } | 59 } |
56 | 60 |
57 virtual bool ConfigureIncomingConnection( | 61 virtual bool ConfigureIncomingConnection( |
58 mojo::ApplicationConnection* connection) override { | 62 mojo::ApplicationConnection* connection) override { |
59 connection->AddService<mojo::ContentHandler>(this); | 63 connection->AddService<mojo::ContentHandler>(this); |
60 return true; | 64 return true; |
61 } | 65 } |
62 | 66 |
63 // Overridden from InterfaceFactory<ContentHandler> | 67 // Overridden from InterfaceFactory<ContentHandler> |
64 virtual void Create(mojo::ApplicationConnection* connection, | 68 virtual void Create(mojo::ApplicationConnection* connection, |
65 mojo::InterfaceRequest<mojo::ContentHandler> request) over
ride { | 69 mojo::InterfaceRequest<mojo::ContentHandler> request) over
ride { |
66 mojo::BindToRequest(new ContentHandlerImpl(), &request); | 70 mojo::BindToRequest(new ContentHandlerImpl(), &request); |
67 } | 71 } |
68 | 72 |
69 scoped_ptr<PlatformImpl> platform_impl_; | 73 scoped_ptr<PlatformImpl> platform_impl_; |
70 | 74 |
71 DISALLOW_COPY_AND_ASSIGN(Viewer); | 75 DISALLOW_COPY_AND_ASSIGN(Viewer); |
72 }; | 76 }; |
73 | 77 |
74 } // namespace mojo | 78 } // namespace mojo |
75 | 79 |
76 MojoResult MojoMain(MojoHandle shell_handle) { | 80 MojoResult MojoMain(MojoHandle shell_handle) { |
77 mojo::ApplicationRunnerChromium runner(new sky::Viewer); | 81 mojo::ApplicationRunnerChromium runner(new sky::Viewer); |
78 return runner.Run(shell_handle); | 82 return runner.Run(shell_handle); |
79 } | 83 } |
OLD | NEW |