Upstream version 9.37.197.0
[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) && !defined(OS_MACOSX)
30   virtual void ZygoteStarting(
31       ScopedVector<content::ZygoteForkDelegate>* delegates) OVERRIDE;
32 #endif
33   virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
34   virtual content::ContentRendererClient*
35       CreateContentRendererClient() OVERRIDE;
36
37   static void InitializeResourceBundle();
38
39  private:
40   scoped_ptr<XWalkRunner> xwalk_runner_;
41   scoped_ptr<content::ContentRendererClient> renderer_client_;
42   scoped_ptr<content::ContentClient> content_client_;
43
44   DISALLOW_COPY_AND_ASSIGN(XWalkMainDelegate);
45 };
46
47 }  // namespace xwalk
48
49 #endif  // XWALK_RUNTIME_APP_XWALK_MAIN_DELEGATE_H_