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_RUNNER_H_ | 5 #ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_ |
6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_ | 6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_ |
7 | 7 |
8 #include <string> | |
9 | |
10 #include "build/build_config.h" | |
11 | |
12 #if defined(OS_WIN) | |
13 #include <windows.h> | |
14 #endif | |
15 | |
16 namespace sandbox { | |
17 struct SandboxInterfaceInfo; | |
18 } | |
19 | |
20 namespace content { | 8 namespace content { |
21 | 9 struct ContentMainParams; |
22 class ContentMainDelegate; | |
23 | 10 |
24 // This class is responsible for content initialization, running and shutdown. | 11 // This class is responsible for content initialization, running and shutdown. |
25 class ContentMainRunner { | 12 class ContentMainRunner { |
26 public: | 13 public: |
27 virtual ~ContentMainRunner() {} | 14 virtual ~ContentMainRunner() {} |
28 | 15 |
29 // Create a new ContentMainRunner object. | 16 // Create a new ContentMainRunner object. |
30 static ContentMainRunner* Create(); | 17 static ContentMainRunner* Create(); |
31 | 18 |
32 // Initialize all necessary content state. | 19 // Initialize all necessary content state. |
33 #if defined(OS_WIN) | 20 virtual int Initialize(const ContentMainParams& params) = 0; |
34 // The |sandbox_info| and |delegate| objects must outlive this class. | |
35 // |sandbox_info| should be initialized using InitializeSandboxInfo from | |
36 // content_main_win.h. | |
37 virtual int Initialize(HINSTANCE instance, | |
38 sandbox::SandboxInterfaceInfo* sandbox_info, | |
39 ContentMainDelegate* delegate) = 0; | |
40 #else | |
41 // The |delegate| object must outlive this class. | |
42 virtual int Initialize(int argc, | |
43 const char** argv, | |
44 ContentMainDelegate* delegate) = 0; | |
45 #endif | |
46 | 21 |
47 // Perform the default run logic. | 22 // Perform the default run logic. |
48 virtual int Run() = 0; | 23 virtual int Run() = 0; |
49 | 24 |
50 // Shut down the content state. | 25 // Shut down the content state. |
51 virtual void Shutdown() = 0; | 26 virtual void Shutdown() = 0; |
52 }; | 27 }; |
53 | 28 |
54 } // namespace content | 29 } // namespace content |
55 | 30 |
56 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_ | 31 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_ |
OLD | NEW |