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/run_application_options_chromium.h" |
| 6 #include "mojo/environment/scoped_chromium_init.h" |
| 7 #include "mojo/public/c/system/main.h" |
| 8 #include "mojo/public/cpp/application/run_application.h" |
| 9 |
5 #if defined(USE_OZONE) | 10 #if defined(USE_OZONE) |
6 #include "services/native_viewport/ozone/app_delegate_ozone.h" | 11 #include "services/native_viewport/ozone/native_viewport_app_ozone.h" |
7 #else | 12 #else |
8 #include "services/native_viewport/app_delegate.h" | 13 #include "services/native_viewport/native_viewport_app.h" |
9 #endif | 14 #endif |
10 | 15 |
11 MojoResult MojoMain(MojoHandle application_request) { | 16 MojoResult MojoMain(MojoHandle application_request) { |
| 17 mojo::ScopedChromiumInit init; |
12 #if defined(USE_OZONE) | 18 #if defined(USE_OZONE) |
13 mojo::ApplicationRunnerChromium runner( | 19 native_viewport::NativeViewportAppOzone native_viewport_app; |
14 new native_viewport::NativeViewportOzoneAppDelegate); | |
15 #else | 20 #else |
16 mojo::ApplicationRunnerChromium runner( | 21 native_viewport::NativeViewportApp native_viewport_app; |
17 new native_viewport::NativeViewportAppDelegate); | |
18 #endif | 22 #endif |
19 runner.set_message_loop_type(base::MessageLoop::TYPE_UI); | 23 mojo::RunApplicationOptionsChromium options(base::MessageLoop::TYPE_UI); |
20 return runner.Run(application_request); | 24 return mojo::RunApplication(application_request, &native_viewport_app, |
| 25 &options); |
21 } | 26 } |
OLD | NEW |