|
OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
jam
2012/01/12 18:07:18
if you intend for this to be a public API to be us
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_APP_CONTENT_MAIN_RUNNER_H_ | |
6 #define CONTENT_APP_CONTENT_MAIN_RUNNER_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "build/build_config.h" | |
12 #include "content/common/content_export.h" | |
13 | |
14 #if defined(OS_WIN) | |
15 #include <windows.h> | |
16 #endif | |
17 | |
18 namespace sandbox { | |
19 struct SandboxInterfaceInfo; | |
20 } | |
21 | |
22 namespace content { | |
23 | |
24 class ContentMainDelegate; | |
25 | |
26 // This class is responsible for content initialization, running and shutdown. | |
27 class ContentMainRunner { | |
28 public: | |
29 virtual ~ContentMainRunner() {} | |
30 | |
31 // Create a new ContentMainRunner object. | |
32 static ContentMainRunner* CreateMainRunner(); | |
jam
2012/01/12 18:07:18
nit: we usually call these just "Create" since Con
| |
33 | |
34 // Initialize all necessary content state. | |
35 #if defined(OS_WIN) | |
36 // The |sandbox_info| and |delegate| objects must outlive this class. | |
37 // |sandbox_info| should be initialized using InitializeSandboxInfo from | |
38 // content_main_win.h. | |
39 virtual int Initialize(HINSTANCE instance, | |
40 sandbox::SandboxInterfaceInfo* sandbox_info, | |
41 ContentMainDelegate* delegate) = 0; | |
42 #else | |
43 // The |delegate| object must outlive this class. | |
44 virtual int Initialize(int argc, | |
45 const char** argv, | |
46 ContentMainDelegate* delegate) = 0; | |
47 #endif | |
48 | |
49 // Perform the default run logic. | |
50 virtual int Run() = 0; | |
51 | |
52 // Shut down the content state. | |
53 virtual void Shutdown() = 0; | |
54 }; | |
55 | |
56 // Return the process type. | |
57 std::string GetProcessType(int argc, const char** argv); | |
jam
2012/01/12 18:07:18
is this really needed? a lot of the code knows how
| |
58 | |
59 } // namespace content | |
60 | |
61 #endif // CONTENT_APP_CONTENT_MAIN_RUNNER_H_ | |
OLD | NEW |