namespace {
const char *LIBRARY_PATH_SEPARATOR = "/";
-const char* FEATURE_WAC20_DEVICAPIS_NAME = "http://wacapps.net/api/deviceapis";
+const char *TIZEN_ROOT_FEATURES = "http://tizen.org/privilege/tizen";
}
class JSPageSession::Impl
void loadInjectedJavaScript();
void installStandardFeatures();
+ void installRootFeatures();
void installRequestedFeatures();
//returns true if success or false if failed
LogInfo("Standard widget features installed.");
}
+void JSPageSession::Impl::installRootFeatures()
+{
+ LogInfo("Installing requested widget features...");
+ WrtDB::FeatureDAOReadOnly dao(TIZEN_ROOT_FEATURES);
+ auto plugin = m_pluginsSupport->getPluginModelById(dao.GetPluginHandle());
+ installPlugin(plugin);
+ LogInfo("requested root feature installed.");
+}
+
bool JSPageSession::Impl::installPlugin(PluginModelPtr plugin)
{
Assert(plugin && "Plugin Model is NULL");
{
LogInfo("Installing requested widget features...");
- //TODO it have to return LIST NOT SET!!!
- WidgetDAOReadOnly widgetDao(m_widgetHandle);
- DbWidgetFeatureSet features = widgetDao.getFeaturesList();
-
- std::list<std::string> allowedFeatures;
-
- FOREACH(it, features)
- {
- LogInfo("Loading api-feature: " << it->name);
- if (it->rejected) {
- LogWarning("Api-feature was rejected by ace. (Api-feature name: "
- << it->name << ")" );
- continue;
- }
-
- allowedFeatures.push_back(DPL::ToUTF8String(it->name));
- }
-
- auto widgetType = widgetDao.getWidgetType();
-
- //WAC2.0 requirement
- if (widgetType == APP_TYPE_WAC20)
- {
- auto it = find(allowedFeatures.begin(),
- allowedFeatures.end(),
- FEATURE_WAC20_DEVICAPIS_NAME);
-
- if (allowedFeatures.end() == it)
- {
- LogInfo("WAC2.0 Deviceapis not declared but added");
- allowedFeatures.push_front(FEATURE_WAC20_DEVICAPIS_NAME);
- }
- }
+ std::list<std::string> allowedFeatures =
+ m_pluginsSupport->getAllowedFeatures(m_widgetHandle);
PluginContainerSupport::PluginsList allowedPlugins;
// return;
// }
//
- auto plugin = m_pluginsSupport->getPluginModelById(pluginHandle);
- if (!plugin) {
- LogError("Failed to load plugin. plugin handle: " << pluginHandle);
- return false;
- }
-
- return installPluginOnDemand(plugin,parentObject,context);
+// auto plugin = m_pluginsSupport->getPluginModelById(pluginHandle);
+// if (!plugin) {
+// LogError("Failed to load plugin. plugin handle: " << pluginHandle);
+// return false;
+// }
+ m_pluginsSupport->registerPluginModel(pluginHandle);
+ return installPluginOnDemand(
+ m_pluginsSupport->getPluginModelById(pluginHandle),
+ parentObject,
+ context);
}
bool JSPageSession::Impl::installPluginOnDemand(PluginModelPtr plugin,
// Register standard features
installStandardFeatures();
+ WidgetDAOReadOnly dao(m_widgetHandle);
+ WidgetType appType = dao.getWidgetType();
+ if (appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
+ installRootFeatures();
+ }
// Register special features
installRequestedFeatures();