Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / app / xwalk_main.cc
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Copyright (c) 2013 Intel Corporation. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 #include "xwalk/runtime/app/xwalk_main_delegate.h"
7 #include "content/public/app/content_main.h"
8
9 #if defined(OS_WIN)
10 #include "content/public/app/startup_helper_win.h"
11 #include "sandbox/win/src/sandbox_types.h"
12 #endif
13
14 #if defined(OS_MACOSX)
15 #include "xwalk/runtime/app/xwalk_content_main.h"
16 #endif
17
18 #if defined(OS_WIN)
19 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) {
20   sandbox::SandboxInterfaceInfo sandbox_info = {0};
21   content::InitializeSandboxInfo(&sandbox_info);
22   xwalk::XWalkMainDelegate delegate;
23   return content::ContentMain(instance, &sandbox_info, &delegate);
24 }
25 #else
26
27 int main(int argc, const char** argv) {
28 #if defined(OS_MACOSX)
29   // Do the delegate work in xwalk_content_main to avoid having to export the
30   // delegate types.
31   return ::ContentMain(argc, argv);
32 #else
33   xwalk::XWalkMainDelegate delegate;
34   return content::ContentMain(argc, argv, &delegate);
35 #endif  // OS_MACOSX
36 }
37
38 #endif