[Release] wrt-installer_0.1.19
[platform/framework/web/wrt-installer.git] / src / jobs / widget_install / task_database.cpp
index d7f4646..7708055 100755 (executable)
@@ -161,29 +161,13 @@ void TaskDatabase::StepSecurityOriginDBInsert()
     FOREACH(it, m_context.widgetConfig.configInfo.privilegeList) {
         std::map<std::string, Feature>::const_iterator result =
             g_W3CPrivilegeTextMap.find(DPL::ToUTF8String(it->name));
-        std::string tizenAppId = DPL::ToUTF8String(m_context.widgetConfig.tzAppid).c_str();
-        std::transform(tizenAppId.begin(), tizenAppId.end(), tizenAppId.begin(), tolower);
         if (result != g_W3CPrivilegeTextMap.end()) {
             if (result->second == FEATURE_USER_MEDIA) {
-                // In case of user media, webkit callback doesn't control origin data
-                // Checking code also useing blank("") scheme and origin
-                SecurityOriginData data(
-                    FEATURE_USER_MEDIA,
-                    Origin(DPL::FromUTF8String(""),
-                           DPL::FromUTF8String(""),
-                           0));
-                dao.setSecurityOriginData(data, RESULT_ALLOW_ALWAYS, true);
+                dao.setPrivilegeSecurityOriginData(result->second, false);
             } else if (result->second == FEATURE_FULLSCREEN_MODE) {
-                // In case of fullscreen mode, use case directly compare
-                // whether web application define privilege name or not
                 continue;
             } else {
-                SecurityOriginData data(
-                    result->second,
-                    Origin(DPL::FromUTF8String("app"),
-                           DPL::FromUTF8String(tizenAppId),
-                           0));
-                dao.setSecurityOriginData(data, RESULT_ALLOW_ALWAYS, true);
+                dao.setPrivilegeSecurityOriginData(result->second);
             }
         }
     }
@@ -333,9 +317,16 @@ void TaskDatabase::StepLiveboxDBInsert()
         LogInfo("livebox id: " << boxId);
         LogInfo("livebox type: " << boxType);
 
+        int autoLaunch;
+        if ((**it).m_autoLaunch == L"true") {
+            autoLaunch = 1;
+        } else {
+            autoLaunch = 0;
+        }
+
         int ret =
-            web_provider_livebox_insert_box_type(
-                boxId.c_str(), tizenId.c_str(), boxType.c_str());
+            web_provider_livebox_insert_box_info(
+                boxId.c_str(), tizenId.c_str(), boxType.c_str(), autoLaunch);
 
         if (ret < 0) {
             LogDebug("failed to set type of livebox: " << boxId);