OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ | 5 #ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ |
6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ | 6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include <windows.h> | 13 #include <windows.h> |
14 #endif | 14 #endif |
15 | 15 |
16 namespace sandbox { | 16 namespace sandbox { |
17 struct SandboxInterfaceInfo; | 17 struct SandboxInterfaceInfo; |
18 } | 18 } |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
22 class ContentMainDelegate; | 22 class ContentMainDelegate; |
23 | 23 |
24 #if !defined(OS_ANDROID) | |
jam
2012/06/01 23:40:00
nit: i think it would be more readable if you chan
michaelbai
2012/06/04 17:39:36
Done.
| |
24 // ContentMain should be called from the embedder's main() function to do the | 25 // ContentMain should be called from the embedder's main() function to do the |
25 // initial setup for every process. The embedder has a chance to customize | 26 // initial setup for every process. The embedder has a chance to customize |
26 // startup using the ContentMainDelegate interface. The embedder can also pass | 27 // startup using the ContentMainDelegate interface. The embedder can also pass |
27 // in NULL for |delegate| if they don't want to override default startup. | 28 // in NULL for |delegate| if they don't want to override default startup. |
28 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
29 | 30 |
30 // |sandbox_info| should be initialized using InitializeSandboxInfo from | 31 // |sandbox_info| should be initialized using InitializeSandboxInfo from |
31 // content_main_win.h | 32 // content_main_win.h |
32 CONTENT_EXPORT int ContentMain(HINSTANCE instance, | 33 CONTENT_EXPORT int ContentMain(HINSTANCE instance, |
33 sandbox::SandboxInterfaceInfo* sandbox_info, | 34 sandbox::SandboxInterfaceInfo* sandbox_info, |
34 ContentMainDelegate* delegate); | 35 ContentMainDelegate* delegate); |
35 #else | 36 #else |
36 CONTENT_EXPORT int ContentMain(int argc, | 37 CONTENT_EXPORT int ContentMain(int argc, |
37 const char** argv, | 38 const char** argv, |
38 ContentMainDelegate* delegate); | 39 ContentMainDelegate* delegate); |
39 #endif | 40 #endif // defined(OS_WIN) |
41 | |
42 #else // !defined(OS_ANDROID) | |
43 // In the Android, the content main starts from ContentMain.java, This function | |
44 // provides a way to initialize the |delegate| as ContentMainDelegate for | |
45 // ContentMainRunner. | |
46 // The ownership of |delegate| is transferred. | |
47 void InitContentMainDelegate(ContentMainDelegate* delegate); | |
jam
2012/06/01 23:40:00
nit: SetContentMainDelegate
michaelbai
2012/06/04 17:39:36
I used 'Init' instead of 'Set' because it can only
jam
2012/06/04 19:26:43
Init sounds like this function will initialize the
| |
48 | |
49 #endif // !defined(OS_ANDROID) | |
40 | 50 |
41 } // namespace content | 51 } // namespace content |
42 | 52 |
43 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ | 53 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ |
OLD | NEW |