| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 base::i18n::InitializeICU(); | 52 base::i18n::InitializeICU(); |
| 53 | 53 |
| 54 mojo::TracingImpl::Create(app); | 54 tracing_.Initialize(app); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual bool ConfigureIncomingConnection( | 57 virtual bool ConfigureIncomingConnection( |
| 58 mojo::ApplicationConnection* connection) override { | 58 mojo::ApplicationConnection* connection) override { |
| 59 connection->AddService<mojo::ContentHandler>(this); | 59 connection->AddService<mojo::ContentHandler>(this); |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Overridden from InterfaceFactory<ContentHandler> | 63 // Overridden from InterfaceFactory<ContentHandler> |
| 64 virtual void Create(mojo::ApplicationConnection* connection, | 64 virtual void Create(mojo::ApplicationConnection* connection, |
| 65 mojo::InterfaceRequest<mojo::ContentHandler> request) over
ride { | 65 mojo::InterfaceRequest<mojo::ContentHandler> request) over
ride { |
| 66 mojo::BindToRequest(new ContentHandlerImpl(), &request); | 66 mojo::BindToRequest(new ContentHandlerImpl(), &request); |
| 67 } | 67 } |
| 68 | 68 |
| 69 scoped_ptr<PlatformImpl> platform_impl_; | 69 scoped_ptr<PlatformImpl> platform_impl_; |
| 70 mojo::TracingImpl tracing_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(Viewer); | 72 DISALLOW_COPY_AND_ASSIGN(Viewer); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace mojo | 75 } // namespace sky |
| 75 | 76 |
| 76 MojoResult MojoMain(MojoHandle shell_handle) { | 77 MojoResult MojoMain(MojoHandle shell_handle) { |
| 77 mojo::ApplicationRunnerChromium runner(new sky::Viewer); | 78 mojo::ApplicationRunnerChromium runner(new sky::Viewer); |
| 78 return runner.Run(shell_handle); | 79 return runner.Run(shell_handle); |
| 79 } | 80 } |
| OLD | NEW |