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