WKBundlePageLoaderClient loaderClient = {
kWKBundlePageLoaderClientCurrentVersion,
this, /* clientinfo */
- didStartProvisionalLoadForFrameCallback, /* StartProvisionLoadForFrm */
+ didStartProvisionalLoadForFrameCallback, /* StartProvisionalLdForFrm */
0, /* didReceiveServerRedirectForProvisionalLoadForFrame */
0, /* didFailProvisionalLoadWithErrorForFrame */
didCommitLoadForFrameCallback, /* didCommitLoadForFrame */
#include <js_overlay_types.h>
#include <i_runnable_widget_object.h>
#include <profiling_util.h>
-#include <wrt-commons/custom-handler-dao-ro/common_dao_types.h>
#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
-#include <wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h>
#include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
#include <popup-runner/PopupInvoker.h>
{
Assert(NULL != wkView && "ewk_view not created at this point");
- FOREACH(it, m_ewkCallbacksMap) {
+ FOREACH(it, m_ewkCallbacksMap)
+ {
evas_object_smart_callback_add(
wkView,
it->first.c_str(),
LogDebug("ewkClientDeinit");
Assert(NULL != wkView && "ewk_view not created at this point");
- FOREACH(it, m_ewkCallbacksMap) {
+ FOREACH(it, m_ewkCallbacksMap)
+ {
evas_object_smart_callback_del(
wkView,
it->first.c_str(),
Assert(wkView);
#ifdef CSP_ENABLED
+ LogInfo("Setting CSP default policy");
ewk_context_tizen_extensible_api_set(
m_ewkContext, EWK_EXTENSIBLE_API_CSP, true);
- LogInfo("Setting CSP default policy");
// setting CSP policy rules
ewk_view_content_security_policy_set(
wkView,
if (customHandler->user_decision == CustomHandlerDB::Declined) {
return;
}
- handlersDao.registerProtocolHandler(*(customHandler.get()));
if (customHandler->user_decision & CustomHandlerDB::Agreed) {
//TODO remove old default handler somehow from appsvc
LogDebug("Registering appservice entry");
TizenId).c_str());
if (APPSVC_RET_OK != ret) {
LogWarning("Appsvc entry failed: " << ret);
+ //no database change
+ return;
}
}
+ handlersDao.registerProtocolHandler(*(customHandler.get()));
+
LogDebug("Protocal saved");
}
if (handler) {
if (handler->user_decision & CustomHandlerDB::Agreed) {
ewk_custom_handlers_data_result_set(
- static_cast<Ewk_Custom_Handlers_Data*>(data),
+ static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
EWK_CUSTOM_HANDLERS_REGISTERED);
} else {
ewk_custom_handlers_data_result_set(
- static_cast<Ewk_Custom_Handlers_Data*>(data),
+ static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
EWK_CUSTOM_HANDLERS_DECLINED);
}
} else {
ewk_custom_handlers_data_result_set(
- static_cast<Ewk_Custom_Handlers_Data*>(data),
+ static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
EWK_CUSTOM_HANDLERS_NEW);
}
This->detachFromCustomHandlersDao();
handlersDao.getProtocolHandler(customHandler->target,
customHandler->url,
customHandler->base_url);
+ This->detachFromCustomHandlersDao();
if (handlerCheck) {
if (handlerCheck->user_decision & CustomHandlerDB::Agreed) {
- appsvc_unset_defapp(DPL::ToUTF8String(This->m_model->TizenId).c_str());
+ int ret = appsvc_unset_defapp(
+ DPL::ToUTF8String(This->m_model->TizenId).c_str());
+ if (APPSVC_RET_OK != ret) {
+ LogWarning("Failed to unregister appsvc entry");
+ return;
+ }
}
-
+ //if appsvc ok change custom_handlers_db
handlersDao.unregisterProtocolHandler(customHandler->target,
customHandler->url,
customHandler->base_url);
} else {
LogDebug("Nothing to unregister");
}
-
- This->detachFromCustomHandlersDao();
}
void ViewLogic::contentHandlerRegistrationCallback(void* data,
if (customHandler->user_decision == CustomHandlerDB::Declined) {
return;
}
- handlersDao.registerContentHandler(*(customHandler.get()));
if (customHandler->user_decision & CustomHandlerDB::Agreed) {
//TODO remove old default handler somehow from appsvc
LogDebug("Registering appservice entry");
TizenId).c_str());
if (APPSVC_RET_OK != ret) {
LogWarning("Appsvc entry failed: " << ret);
+ return;
}
}
+ handlersDao.registerContentHandler(*(customHandler.get()));
LogDebug("Content saved");
}
This->detachFromCustomHandlersDao();
if (handler) {
if (handler->user_decision & CustomHandlerDB::Agreed) {
ewk_custom_handlers_data_result_set(
- static_cast<Ewk_Custom_Handlers_Data*>(data),
+ static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
EWK_CUSTOM_HANDLERS_REGISTERED);
} else {
ewk_custom_handlers_data_result_set(
- static_cast<Ewk_Custom_Handlers_Data*>(data),
+ static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
EWK_CUSTOM_HANDLERS_DECLINED);
}
} else {
ewk_custom_handlers_data_result_set(
- static_cast<Ewk_Custom_Handlers_Data*>(data),
+ static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
EWK_CUSTOM_HANDLERS_NEW);
}
This->detachFromCustomHandlersDao();
handlersDao.getContentHandler(customHandler->target,
customHandler->url,
customHandler->base_url);
+ This->detachFromCustomHandlersDao();
if (handlerCheck) {
if (handlerCheck->user_decision & CustomHandlerDB::Agreed) {
- appsvc_unset_defapp(DPL::ToUTF8String(This->m_model->TizenId).c_str());
+ int ret = appsvc_unset_defapp(
+ DPL::ToUTF8String(This->m_model->TizenId).c_str());
+ if (APPSVC_RET_OK != ret) {
+ LogWarning("Failed to unregister mime handler from appsvc");
+ return;
+ }
}
-
handlersDao.unregisterContentHandler(customHandler->target,
customHandler->url,
customHandler->base_url);
} else {
LogDebug("Nothing to unregister");
}
- This->detachFromCustomHandlersDao();
}
void ViewLogic::didRunJavaScriptCallback(
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file view_logic_utils.cpp
- * @author Lukasz Marek (l.marek@samsung.com)
- * @brief Implementation file of utils API used by ViewLogic
- */
-
-#include "view_logic_utils.h"
-
-namespace ViewModule {
-namespace Utils {
-DPL::OptionalString toString(WKStringRef str)
-{
- if (WKStringIsEmpty(str)) {
- return DPL::OptionalString::Null;
- }
- size_t size = WKStringGetMaximumUTF8CStringSize(str);
- char buffer[size + 1];
- WKStringGetUTF8CString(str, buffer, size + 1);
- return DPL::FromUTF8String(buffer);
-}
-
-DPL::OptionalString toString(WKURLRef url)
-{
- WKStringRef urlStr = WKURLCopyString(url);
- DPL::OptionalString str = toString(urlStr);
- WKRelease(urlStr);
- return str;
-}
-
-DPL::OptionalString toString(WKURLRequestRef req)
-{
- WKURLRef reqUrl = WKURLRequestCopyURL(req);
- DPL::OptionalString str = toString(reqUrl);
- WKRelease(reqUrl);
- return str;
-}
-
-DPL::OptionalString toString(WKFrameRef req)
-{
- WKURLRef reqUrl = WKFrameCopyURL(req);
- DPL::OptionalString str = toString(reqUrl);
- WKRelease(reqUrl);
- return str;
-}
-
-DPL::OptionalString toString(WKErrorRef err)
-{
- WKStringRef domErr = WKErrorCopyDomain(err);
- WKStringRef desc = WKErrorCopyLocalizedDescription(err);
- DPL::String str =
- (WKStringIsEmpty(domErr) ? L"null" : *toString(domErr)) +
- L"\n" +
- (WKStringIsEmpty(desc) ? L"null" : *toString(desc));
- WKRelease(domErr);
- WKRelease(desc);
- return str;
-}
-} // namespace Utils
-} // namespace ViewModule
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @file view_logic_utils.h
- * @author Lukasz Marek (l.marek@samsung.com)
- * @brief Header file of utils API used by ViewLogic
- */
-
-#ifndef VIEW_LOGIC_UTILS_H_
-#define VIEW_LOGIC_UTILS_H_
-
-#include <WebKit2.h>
-#include <dpl/string.h>
-#include <dpl/optional_typedefs.h>
-
-namespace ViewModule {
-namespace Utils {
-DPL::OptionalString toString(WKStringRef str);
-DPL::OptionalString toString(WKURLRef url);
-DPL::OptionalString toString(WKURLRequestRef req);
-DPL::OptionalString toString(WKFrameRef req);
-DPL::OptionalString toString(WKErrorRef err);
-} // namespace Utils
-} // namespace ViewModule
-
-#endif /* VIEW_LOGIC_UTILS_H_ */
char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
char const* const ELM_SWALLOW_BACKWARD = "elm.swallow.backward";
+const char *ELM_EVENT_PROFILE_CHANGED = "profile,changed";
+
char const* const ELM = "elm";
char const* const LAYOUT = "layout";
char const* const APPLICATION = "application";
char const* const NOINDICATOR = "noindicator";
char const* const INTERNAL_LAYOUT = "internal_layout";
char const* const FLOATBACKWARD_BUTTON_STYLE = "wrt/backward";
+const std::string DESKTOP_PROFILE("desktop");
} // anonymous namespace
WindowData::WindowData(unsigned long pid, bool manualInit) :
ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
evas_object_resize(window, w, h);
+ evas_object_smart_callback_add(window,
+ ELM_EVENT_PROFILE_CHANGED,
+ winProfileChangedCallback,
+ this);
return window;
}
layout,
/* const char *item_style */
NULL);
+ ADD_PROFILING_POINT("elm_naviframe_item_push", "stop");
elm_naviframe_item_title_visible_set(naviIt, EINA_FALSE);
return layout;
}
+void WindowData::setDesktopIcon()
+{
+ // set window icon
+ Evas_Object *icon = evas_object_image_add(evas_object_evas_get(m_win));
+ evas_object_image_file_set(icon,
+ "/opt/share/icons/default/small/tizenScmgz.png",
+ NULL);
+ elm_win_icon_object_set(m_win, icon);
+}
+
void WindowData::addNaviBackButtonCallback(
const char* event,
CallbackType callback,
alreadyFullscreen = !alreadyFullscreen;
}
+
+void WindowData::winProfileChangedCallback(void *data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
+{
+ LogDebug("winProfileChangedCallback");
+ if (data == NULL) {
+ return;
+ }
+ WindowData* This = static_cast<WindowData *>(data);
+ const char *profile = elm_config_profile_get();
+
+ if (DESKTOP_PROFILE == profile) {
+ elm_win_indicator_mode_set(This->m_win, ELM_WIN_INDICATOR_HIDE);
+ This->setDesktopIcon();
+ }
+}
+
bool backbutton);
void toggleFullscreen(bool fullscreen);
+ static void winProfileChangedCallback(void *data,
+ Evas_Object * obj,
+ void *event_info);
protected:
Evas_Object* m_conformant;
void alignProgressPosition();
void toggleIndicator(bool fullscreen);
void createFloatBackButton();
+ void setDesktopIcon();
};
#endif /* WINDOW_INITIALIZE_H_ */
#define SQLITE_FLUSH_MAX (1048576) /* (1024*1024) */
#define AUL_POLL_CNT 15
#define AUL_PR_NAME 16
+#define PKG_ID_LENGTH 11
#define PATH_APP_ROOT "/opt/usr/apps"
#define PATH_DATA "/data"
#define SDK_CODE_COVERAGE "CODE_COVERAGE"
__set_oom();
/* SET PRIVILEGES*/
- if (__set_access(pkg_name, menu_info->pkg_type, app_path) < 0) {
+ char pkg_id[PKG_ID_LENGTH];
+ memset(pkg_id, '\0', PKG_ID_LENGTH);
+ snprintf(pkg_id, PKG_ID_LENGTH, "%s", pkg_name);
+
+ if (__set_access(pkg_id, menu_info->pkg_type, app_path) < 0) {
_D("fail to set privileges - check your package's credential\n");
return -1;
}
static int __cb_x_error(Display* disp, XErrorEvent *ev)
{
+ //warning unused parameter
(void)disp;
+
_E("X error received - Error Code = %d", ev->error_code);
return 0;
}