Ignore title parameter for navigator.registerProtocolHandler
[chromium-blink-merge.git] / mojo / services / view_manager / main.cc
blob7754a1ee8bee7e7f65eabb0a4f25caa35e34f82f
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.
5 #include "base/at_exit.h"
6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h"
8 #include "mojo/public/cpp/shell/application.h"
9 #include "mojo/services/view_manager/root_node_manager.h"
10 #include "mojo/services/view_manager/view_manager_connection.h"
12 #if defined(WIN32)
13 #if !defined(CDECL)
14 #define CDECL __cdecl)
15 #endif
16 #define VIEW_MANAGER_EXPORT __declspec(dllexport)
17 #else
18 #define CDECL
19 #define VIEW_MANAGER_EXPORT __attribute__((visibility("default")))
20 #endif
22 extern "C" VIEW_MANAGER_EXPORT MojoResult CDECL MojoMain(
23 MojoHandle shell_handle) {
24 CommandLine::Init(0, NULL);
25 base::AtExitManager at_exit;
26 base::MessageLoop loop;
27 mojo::Application app(shell_handle);
28 mojo::services::view_manager::RootNodeManager root_node_manager(app.shell());
29 app.AddServiceConnector(
30 new mojo::ServiceConnector<
31 mojo::services::view_manager::ViewManagerConnection,
32 mojo::services::view_manager::RootNodeManager>(&root_node_manager));
33 loop.Run();
35 return MOJO_RESULT_OK;