Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: content/public/app/content_main.h

Issue 190663012: Run ContentMain in a browser_test's browser process. This removes duplication of code in the browse… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: try to fix android by restoring old path just for it Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 11 #include "build/build_config.h"
11 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
12 13
13 #if defined(OS_WIN) 14 #if defined(OS_WIN)
14 #include <windows.h> 15 #include <windows.h>
15 #endif 16 #endif
16 17
17 namespace sandbox { 18 namespace sandbox {
18 struct SandboxInterfaceInfo; 19 struct SandboxInterfaceInfo;
19 } 20 }
20 21
21 namespace content { 22 namespace content {
22 class ContentMainDelegate; 23 class ContentMainDelegate;
23 24
24 struct ContentMainParams { 25 struct ContentMainParams {
25 explicit ContentMainParams(ContentMainDelegate* delegate) 26 explicit ContentMainParams(ContentMainDelegate* delegate)
26 : delegate(delegate) 27 : delegate(delegate),
27 #if defined(OS_WIN) 28 #if defined(OS_WIN)
28 , instance(NULL), 29 instance(NULL),
29 sandbox_info(NULL) 30 sandbox_info(NULL),
30 #elif !defined(OS_ANDROID) 31 #elif !defined(OS_ANDROID)
31 , argc(0), 32 argc(0),
32 argv(NULL) 33 argv(NULL),
33 #endif 34 #endif
34 { 35 ui_task(NULL) {
35 } 36 }
36 37
37 ContentMainDelegate* delegate; 38 ContentMainDelegate* delegate;
38 39
39 #if defined(OS_WIN) 40 #if defined(OS_WIN)
40 HINSTANCE instance; 41 HINSTANCE instance;
41 42
42 // |sandbox_info| should be initialized using InitializeSandboxInfo from 43 // |sandbox_info| should be initialized using InitializeSandboxInfo from
43 // content_main_win.h 44 // content_main_win.h
44 sandbox::SandboxInterfaceInfo* sandbox_info; 45 sandbox::SandboxInterfaceInfo* sandbox_info;
45 #elif !defined(OS_ANDROID) 46 #elif !defined(OS_ANDROID)
46 int argc; 47 int argc;
47 const char** argv; 48 const char** argv;
48 #endif 49 #endif
50
51 // Used by browser_tests. If non-null BrowserMain schedules this task to run
52 // on the MessageLoop. It's owned by the test code.
53 base::Closure* ui_task;
49 }; 54 };
50 55
51 #if defined(OS_ANDROID) 56 #if defined(OS_ANDROID)
52 // In the Android, the content main starts from ContentMain.java, This function 57 // In the Android, the content main starts from ContentMain.java, This function
53 // provides a way to set the |delegate| as ContentMainDelegate for 58 // provides a way to set the |delegate| as ContentMainDelegate for
54 // ContentMainRunner. 59 // ContentMainRunner.
55 // This should only be called once before ContentMainRunner actually running. 60 // This should only be called once before ContentMainRunner actually running.
56 // The ownership of |delegate| is transferred. 61 // The ownership of |delegate| is transferred.
57 CONTENT_EXPORT void SetContentMainDelegate(ContentMainDelegate* delegate); 62 CONTENT_EXPORT void SetContentMainDelegate(ContentMainDelegate* delegate);
58 #else 63 #else
59 // ContentMain should be called from the embedder's main() function to do the 64 // ContentMain should be called from the embedder's main() function to do the
60 // initial setup for every process. The embedder has a chance to customize 65 // initial setup for every process. The embedder has a chance to customize
61 // startup using the ContentMainDelegate interface. The embedder can also pass 66 // startup using the ContentMainDelegate interface. The embedder can also pass
62 // in NULL for |delegate| if they don't want to override default startup. 67 // in NULL for |delegate| if they don't want to override default startup.
63 CONTENT_EXPORT int ContentMain(const ContentMainParams& params); 68 CONTENT_EXPORT int ContentMain(const ContentMainParams& params);
64 #endif 69 #endif
65 70
66 } // namespace content 71 } // namespace content
67 72
68 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ 73 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698