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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_
6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_
10 #include "build/build_config.h"
17 struct SandboxInterfaceInfo
;
22 class ContentMainDelegate
;
24 // This class is responsible for content initialization, running and shutdown.
25 class ContentMainRunner
{
27 virtual ~ContentMainRunner() {}
29 // Create a new ContentMainRunner object.
30 static ContentMainRunner
* Create();
32 // Initialize all necessary content state.
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;
41 // The |delegate| object must outlive this class.
42 virtual int Initialize(int argc
,
44 ContentMainDelegate
* delegate
) = 0;
47 // Perform the default run logic.
48 virtual int Run() = 0;
50 // Shut down the content state.
51 virtual void Shutdown() = 0;
54 } // namespace content
56 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_