Merge pull request #110 from crosswalk-project/revert-101-fix_v8_dep
[platform/framework/web/crosswalk-tizen.git] / extensions / renderer / xwalk_extension_renderer_controller.h
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 #ifndef XWALK_EXTENSIONS_RENDERER_XWALK_EXTENSION_RENDERER_CONTROLLER_H_
7 #define XWALK_EXTENSIONS_RENDERER_XWALK_EXTENSION_RENDERER_CONTROLLER_H_
8
9 #include <ewk_chromium.h>
10 #include <v8/v8.h>
11
12 #include <memory>
13 #include <string>
14
15 namespace extensions {
16
17 class XWalkExtensionClient;
18
19 class XWalkExtensionRendererController {
20  public:
21   static XWalkExtensionRendererController& GetInstance();
22
23   void DidCreateScriptContext(v8::Handle<v8::Context> context);
24   void WillReleaseScriptContext(v8::Handle<v8::Context> context);
25
26   void OnReceivedIPCMessage(const Ewk_IPC_Wrt_Message_Data* data);
27
28   void InitializeExtensionClient();
29   void LoadUserExtensions(const std::string app_path);
30
31  private:
32   XWalkExtensionRendererController();
33   virtual ~XWalkExtensionRendererController();
34
35  private:
36   std::unique_ptr<XWalkExtensionClient> extensions_client_;
37 };
38
39 }  // namespace extensions
40
41 #endif  // XWALK_EXTENSIONS_RENDERER_XWALK_EXTENSION_RENDERER_CONTROLLER_H_