forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cc
56 lines (47 loc) · 1.43 KB
/
main.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "weblayer/public/main.h"
#include "build/build_config.h"
#include "content/public/app/content_main.h"
#include "weblayer/app/content_main_delegate_impl.h"
#if defined(OS_WIN)
#include "base/win/win_util.h"
#include "content/public/app/sandbox_helper_win.h"
#include "sandbox/win/src/sandbox_types.h"
#endif
namespace weblayer {
MainParams::MainParams() = default;
MainParams::MainParams(const MainParams& other) = default;
MainParams::~MainParams() = default;
#if !defined(OS_ANDROID)
int Main(MainParams params
#if defined(OS_WIN)
#if !defined(WIN_CONSOLE_APP)
,
HINSTANCE instance
#endif
#else
,
int argc,
const char** argv
#endif
) {
ContentMainDelegateImpl delegate(std::move(params));
content::ContentMainParams content_params(&delegate);
#if defined(OS_WIN)
#if defined(WIN_CONSOLE_APP)
HINSTANCE instance = GetModuleHandle(nullptr);
#endif
sandbox::SandboxInterfaceInfo sandbox_info = {nullptr};
content::InitializeSandboxInfo(&sandbox_info);
content_params.instance = instance;
content_params.sandbox_info = &sandbox_info;
#else
content_params.argc = argc;
content_params.argv = argv;
#endif
return content::ContentMain(std::move(content_params));
}
#endif // !defined(OS_ANDROID)
} // namespace weblayer