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/at_exit.h" | |
6 #include "base/command_line.h" | |
5 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
6 #include "mojo/public/cpp/shell/application.h" | 8 #include "mojo/public/cpp/shell/application.h" |
7 #include "mojo/services/view_manager/root_node_manager.h" | 9 #include "mojo/services/view_manager/root_node_manager.h" |
8 #include "mojo/services/view_manager/view_manager_connection.h" | 10 #include "mojo/services/view_manager/view_manager_connection.h" |
11 #include "ui/aura/env.h" | |
Ben Goodger (Google)
2014/05/07 17:21:36
???
sky
2014/05/07 17:33:22
Done.
| |
9 | 12 |
10 #if defined(WIN32) | 13 #if defined(WIN32) |
11 #if !defined(CDECL) | 14 #if !defined(CDECL) |
12 #define CDECL __cdecl) | 15 #define CDECL __cdecl) |
13 #endif | 16 #endif |
14 #define VIEW_MANAGER_EXPORT __declspec(dllexport) | 17 #define VIEW_MANAGER_EXPORT __declspec(dllexport) |
15 #else | 18 #else |
16 #define CDECL | 19 #define CDECL |
17 #define VIEW_MANAGER_EXPORT __attribute__((visibility("default"))) | 20 #define VIEW_MANAGER_EXPORT __attribute__((visibility("default"))) |
18 #endif | 21 #endif |
19 | 22 |
20 extern "C" VIEW_MANAGER_EXPORT MojoResult CDECL MojoMain( | 23 extern "C" VIEW_MANAGER_EXPORT MojoResult CDECL MojoMain( |
21 MojoHandle shell_handle) { | 24 MojoHandle shell_handle) { |
25 CommandLine::Init(0, NULL); | |
26 base::AtExitManager at_exit; | |
22 base::MessageLoop loop; | 27 base::MessageLoop loop; |
23 mojo::Application app(shell_handle); | 28 mojo::Application app(shell_handle); |
24 mojo::services::view_manager::RootNodeManager root_node_manager; | 29 mojo::services::view_manager::RootNodeManager root_node_manager(app.shell()); |
25 app.AddServiceConnector(new mojo::ServiceConnector | 30 app.AddServiceConnector(new mojo::ServiceConnector |
26 <mojo::services::view_manager::ViewManagerConnection, | 31 <mojo::services::view_manager::ViewManagerConnection, |
27 mojo::services::view_manager::RootNodeManager>( | 32 mojo::services::view_manager::RootNodeManager>( |
28 &root_node_manager)); | 33 &root_node_manager)); |
29 loop.Run(); | 34 loop.Run(); |
30 | 35 |
31 return MOJO_RESULT_OK; | 36 return MOJO_RESULT_OK; |
32 } | 37 } |
OLD | NEW |