summaryrefslogtreecommitdiff
path: root/chromium/content/public/app/content_main_runner.h
blob: bed5ff2715cf87b0ca949c8b8a369a0a6c69c4d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_
#define CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_

#include <string>

#include "build/build_config.h"

#if defined(OS_WIN)
#include <windows.h>
#endif

namespace sandbox {
struct SandboxInterfaceInfo;
}

namespace content {

class ContentMainDelegate;

// This class is responsible for content initialization, running and shutdown.
class ContentMainRunner {
 public:
  virtual ~ContentMainRunner() {}

  // Create a new ContentMainRunner object.
  static ContentMainRunner* Create();

  // Initialize all necessary content state.
#if defined(OS_WIN)
  // The |sandbox_info| and |delegate| objects must outlive this class.
  // |sandbox_info| should be initialized using InitializeSandboxInfo from
  // content_main_win.h.
  virtual int Initialize(HINSTANCE instance,
                         sandbox::SandboxInterfaceInfo* sandbox_info,
                         ContentMainDelegate* delegate) = 0;
#else
  // The |delegate| object must outlive this class.
  virtual int Initialize(int argc,
                         const char** argv,
                         ContentMainDelegate* delegate) = 0;
#endif

  // Perform the default run logic.
  virtual int Run() = 0;

  // Shut down the content state.
  virtual void Shutdown() = 0;
};

}  // namespace content

#endif  // CONTENT_PUBLIC_APP_CONTENT_MAIN_RUNNER_H_