2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file injected_bundle_plugin_interface.cpp
18 * @author Lukasz Marek (l.marek@samgsung.com)
19 * @author Yunchan Cho (yunchan.cho@samgsung.com)
24 #include "injected_bundle_plugin_interface.h"
26 #include <dpl/log/wrt_log.h>
27 #include <dpl/string.h>
28 #include <dpl/assert.h>
29 #include <plugin_logic.h>
30 #include <js_overlay_types.h>
32 namespace InjectedBundlePluginInterface {
33 void init(int widgetHandle)
36 PluginLogicSingleton::Instance().initSession(widgetHandle);
39 void start(int widgetHandle,
40 JSGlobalContextRef context,
42 const char *encodedBundle,
45 PluginLogicSingleton::Instance().startSession(widgetHandle,
55 PluginLogicSingleton::Instance().performLibrariesUnload();
58 void stop(JSGlobalContextRef context)
61 PluginLogicSingleton::Instance().stopSession(context);
64 void setCustomProperties(JSGlobalContextRef context,
66 const char* encodedBundle,
70 PluginLogicSingleton::Instance().setCustomProperties(context,
76 void dispatchJavaScriptEvent(JSGlobalContextRef context,
77 WrtPlugins::W3C::CustomEventType eventType,
81 PluginLogicSingleton::Instance().dispatchJavaScriptEvent(context,
86 void loadFrame(JSGlobalContextRef context)
88 WrtLogD("load frame into web page");
89 PluginLogicSingleton::Instance().loadFrame(context);
92 void unloadFrame(JSGlobalContextRef context)
94 WrtLogD("unload frame from web page");
95 PluginLogicSingleton::Instance().unloadFrame(context);
97 } // namespace InjectedBundlePluginInterface