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 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
15 #include <windows.h> | 15 #include <windows.h> |
16 #endif | 16 #endif |
17 | 17 |
| 18 #if defined(USE_AURA) |
| 19 #include "ui/aura/env.h" |
| 20 #endif |
| 21 |
18 namespace sandbox { | 22 namespace sandbox { |
19 struct SandboxInterfaceInfo; | 23 struct SandboxInterfaceInfo; |
20 } | 24 } |
21 | 25 |
22 namespace content { | 26 namespace content { |
23 class ContentMainDelegate; | 27 class ContentMainDelegate; |
24 | 28 |
25 struct ContentMainParams { | 29 struct ContentMainParams { |
26 explicit ContentMainParams(ContentMainDelegate* delegate) | 30 explicit ContentMainParams(ContentMainDelegate* delegate) |
27 : delegate(delegate), | 31 : delegate(delegate), |
(...skipping 16 matching lines...) Expand all Loading... |
44 // content_main_win.h | 48 // content_main_win.h |
45 sandbox::SandboxInterfaceInfo* sandbox_info; | 49 sandbox::SandboxInterfaceInfo* sandbox_info; |
46 #elif !defined(OS_ANDROID) | 50 #elif !defined(OS_ANDROID) |
47 int argc; | 51 int argc; |
48 const char** argv; | 52 const char** argv; |
49 #endif | 53 #endif |
50 | 54 |
51 // Used by browser_tests. If non-null BrowserMain schedules this task to run | 55 // Used by browser_tests. If non-null BrowserMain schedules this task to run |
52 // on the MessageLoop. It's owned by the test code. | 56 // on the MessageLoop. It's owned by the test code. |
53 base::Closure* ui_task; | 57 base::Closure* ui_task; |
| 58 |
| 59 #if defined(USE_AURA) |
| 60 aura::Env::Mode env_mode = aura::Env::Mode::LOCAL; |
| 61 #endif |
54 }; | 62 }; |
55 | 63 |
56 #if defined(OS_ANDROID) | 64 #if defined(OS_ANDROID) |
57 // In the Android, the content main starts from ContentMain.java, This function | 65 // In the Android, the content main starts from ContentMain.java, This function |
58 // provides a way to set the |delegate| as ContentMainDelegate for | 66 // provides a way to set the |delegate| as ContentMainDelegate for |
59 // ContentMainRunner. | 67 // ContentMainRunner. |
60 // This should only be called once before ContentMainRunner actually running. | 68 // This should only be called once before ContentMainRunner actually running. |
61 // The ownership of |delegate| is transferred. | 69 // The ownership of |delegate| is transferred. |
62 CONTENT_EXPORT void SetContentMainDelegate(ContentMainDelegate* delegate); | 70 CONTENT_EXPORT void SetContentMainDelegate(ContentMainDelegate* delegate); |
63 #else | 71 #else |
64 // ContentMain should be called from the embedder's main() function to do the | 72 // ContentMain should be called from the embedder's main() function to do the |
65 // initial setup for every process. The embedder has a chance to customize | 73 // initial setup for every process. The embedder has a chance to customize |
66 // startup using the ContentMainDelegate interface. The embedder can also pass | 74 // startup using the ContentMainDelegate interface. The embedder can also pass |
67 // in NULL for |delegate| if they don't want to override default startup. | 75 // in NULL for |delegate| if they don't want to override default startup. |
68 CONTENT_EXPORT int ContentMain(const ContentMainParams& params); | 76 CONTENT_EXPORT int ContentMain(const ContentMainParams& params); |
69 #endif | 77 #endif |
70 | 78 |
71 } // namespace content | 79 } // namespace content |
72 | 80 |
73 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ | 81 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ |
OLD | NEW |