cec8a1b5c2c9256f1f48426c9a84b5e774b0dc57
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / app / xwalk_main_delegate.h
1 // Copyright (c) 2013 Intel Corporation. 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 XWALK_RUNTIME_APP_XWALK_MAIN_DELEGATE_H_
6 #define XWALK_RUNTIME_APP_XWALK_MAIN_DELEGATE_H_
7
8 #include <string>
9
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/app/content_main_delegate.h"
13 #include "xwalk/runtime/common/xwalk_content_client.h"
14
15 namespace xwalk {
16
17 class XWalkRunner;
18
19 class XWalkMainDelegate : public content::ContentMainDelegate {
20  public:
21   XWalkMainDelegate();
22   virtual ~XWalkMainDelegate();
23
24   // ContentMainDelegate implementation:
25   virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
26   virtual void PreSandboxStartup() OVERRIDE;
27   virtual int RunProcess(const std::string& process_type,
28       const content::MainFunctionParams& main_function_params) OVERRIDE;
29 #if defined(OS_POSIX) && !defined(OS_ANDROID)
30   virtual content::ZygoteForkDelegate* ZygoteStarting();
31 #endif
32   virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
33   virtual content::ContentRendererClient*
34       CreateContentRendererClient() OVERRIDE;
35
36   static void InitializeResourceBundle();
37
38  private:
39   scoped_ptr<XWalkRunner> xwalk_runner_;
40   scoped_ptr<content::ContentRendererClient> renderer_client_;
41   scoped_ptr<content::ContentClient> content_client_;
42
43   DISALLOW_COPY_AND_ASSIGN(XWalkMainDelegate);
44 };
45
46 }  // namespace xwalk
47
48 #endif  // XWALK_RUNTIME_APP_XWALK_MAIN_DELEGATE_H_