Upstream version 11.40.277.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   bool BasicStartupComplete(int* exit_code) override;
26   void PreSandboxStartup() override;
27   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   void ZygoteStarting(
31       ScopedVector<content::ZygoteForkDelegate>* delegates) override;
32 #endif
33   content::ContentBrowserClient* CreateContentBrowserClient() override;
34   content::ContentRendererClient* 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_