OPTION(WITH_TESTS "Build tests" OFF)
#enable csp policy support
OPTION(CSP_SUPPORT "Support for csp policy" OFF)
+OPTION(APP_SCHEME_SUPPORT "Support for app:// scheme" OFF)
+OPTION(CORS_WHITELISTING_SUPPORT "CORS white listing for access positions" OFF)
IF(CSP_SUPPORT)
ADD_DEFINITIONS("-DCSP_ENABLED")
ENDIF(CSP_SUPPORT)
+IF(APP_SCHEME_SUPPORT)
+ ADD_DEFINITIONS("-DAPP_SCHEME_ENABLED")
+ENDIF(APP_SCHEME_SUPPORT)
+IF(CORS_WHITELISTING_SUPPORT)
+ ADD_DEFINITIONS("-DCORS_WHITELISTING_ENABLED")
+ENDIF(CORS_WHITELISTING_SUPPORT)
# logs can be only enabled in debug mode
IF(CMAKE_BUILD_TYPE MATCHES "Profiling" AND DPL_LOG)
MESSAGE(STATUS "Logging disabled for DPL")
-wrt (0.8.16) unstable; urgency=low
+wrt (0.8.167) unstable; urgency=low
+
+ * Force encoding as specified in config.xml
+ * Fixed inspector launch fail issue
+ * Replace window rotation API
+ * Remove unused source
+
+ -- Jihoon Chung <jihoon.chung@samsung.com> Mon, 25 Mar 2013 20:21:46 +0900
+
+wrt (0.8.166) unstable; urgency=low
* WRT Process Pool Model
* Source clean up (case of launch browser)
-#git:framework/web/wrt wrt_0.8.166
+#git:framework/web/wrt wrt_0.8.167
Name: wrt
Summary: web runtime
-Version: 0.8.166
+Version: 0.8.167
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
value << "]");
m_BackButtonPresence = BackButton_Disable;
}
- } else if (name == SETTING_NAME_CONTEXT_MENU
-#ifndef DEPRECATED_SETTING_STRING
- || name == SETTING_NAME_CONTEXTMENU
-#endif
- )
+ } else if (name == SETTING_NAME_CONTEXT_MENU)
{
if (value == SETTING_VALUE_ENABLE) {
m_ContextMenu = ContextMenu_Enable;
L"indicator-presence";
static const DPL::String SETTING_NAME_BACKBUTTON_PRESENCE =
L"backbutton-presence";
-#ifndef DEPRECATED_SETTING_STRING
-static const DPL::String SETTING_NAME_CONTEXTMENU =
- L"contextmenu";
-#endif
-static const DPL::String SETTING_NAME_CONTEXT_MENU =
+ static const DPL::String SETTING_NAME_CONTEXT_MENU =
L"context-menu";
static const DPL::String SETTING_NAME_BACKGROUND_SUPPORT =
L"background-support";
StartURL(this),
//localized, so not binded
StartFileInfo(this),
+#ifdef APP_SCHEME_ENABLED
+ PrefixURL(this, DPL::String(L"app://") + DPL::FromASCIIString(tizenId) + L"/"),
+#else
//localized, so not binded
// file:// + / : without "/" path, webkit return security error
PrefixURL(this, L"file:///"),
+#endif
InstallPath(
this,
&BindToWidgetDAO<DPL::String, &WidgetDAOReadOnly::getFullPath>::Get),
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_apps_support.cpp
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_custom_header_support.cpp
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_support.cpp
- ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_geolocation_support.cpp
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_password_support.cpp
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_support.cpp
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_origin_support.cpp
"http",
"https",
"widget",
+#ifdef APP_SCHEME_ENABLED
+ "app",
+#endif
"vnd.youtube",
"rtsp"
};
HTTP,
HTTPS,
WIDGET,
+#ifdef APP_SCHEME_ENABLED
+ APP,
+#endif
YOUTUBE,
RTSP,
{ URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // HTTP
{ URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // HTTPS
{ URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // WIDGET
+#ifdef APP_SCHEME_ENABLED
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT }, // APP
+#endif
{ URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }, // YOUTUBE
{ URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO } // RTSP
};
{ URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC }, // HTTP
{ URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC }, // HTTPS
{ URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC }, // WIDGET
+#ifdef APP_SCHEME_ENABLED
+ { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC }, // APP
+#endif
{ URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }, // YOUTUBE
{ URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO } // RTSP
};
+++ /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_geolocation_support.cpp
- * @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
- */
-
-#include "view_logic_geolocation_support.h"
-
-#include <dpl/log/log.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-#include <popup-runner/PopupInvoker.h>
-#include <view_logic_security_support.h>
-
-namespace {
-const char * const GEOLOCATION_ASK_TITLE = "location info";
-const char * const GEOLOCATION_ASK_MSG =
- "Application requests your current location. Do you allow it?";
-}
-
-namespace ViewModule {
-namespace GeolocationSupport {
-bool askUserForPermission()
-{
- return Wrt::Popup::PopupInvoker().askYesNo(
- GEOLOCATION_ASK_TITLE,
- GEOLOCATION_ASK_MSG);
-}
-
-bool checkRequestedStateOfGeolocationFeature(WrtDB::WidgetDAOReadOnlyPtr dao)
-{
- WrtDB::DbWidgetFeature geolocationFeature;
- geolocationFeature.name = DPL::FromASCIIString(
- WrtDB::GlobalConfig::GetW3CGeolocationFeatureName() );
-
- auto features = dao->getFeaturesList();
-
- auto it = features.find(geolocationFeature);
-
- if (it != features.end() ) {
- if (it->rejected) {
- LogInfo("Feature rejected by ACE");
- return false;
- }
- return true;
- }
-
- return false;
-}
-
-bool getLocalizationState(const DPL::String& tizenId, bool enableHighAccuracy)
-{
- LogDebug("Get localization state");
-
- WrtDB::WidgetDAOReadOnlyPtr dao(new WrtDB::WidgetDAOReadOnly(tizenId));
-
- if (dao->getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) {
- return askUserForPermission();
- }
-
- return checkRequestedStateOfGeolocationFeature(dao) &&
- ViewModule::SecuritySupport::geolocationACECheck(tizenId,
- enableHighAccuracy);
-}
-
-bool getGeolocationModuleState(const DPL::String& tizenId)
-{
- LogDebug("Get geolocation state");
-
- WrtDB::WidgetDAOReadOnlyPtr dao(new WrtDB::WidgetDAOReadOnly(tizenId));
-
- if (dao->getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) {
- LogInfo("Geolocation enable for tizen app");
- return true;
- }
-
- return checkRequestedStateOfGeolocationFeature(dao);
-}
-} // namespace GeolocationSupport
-} // 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_geolocations_support.h
- * @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
- */
-
-#ifndef VIEW_LOGIC_GEOLOCATION_SUPPORT_H_
-#define VIEW_LOGIC_GEOLOCATION_SUPPORT_H_
-
-#include <dpl/string.h>
-
-namespace ViewModule {
-namespace GeolocationSupport {
-/*
- * @returns true if user allowed for share current position
- * @returns false otherwise
- */
-bool getLocalizationState(const DPL::String& tizenId, bool enableHighAccuracy);
-
-/*
- * The function returns requested state of geolocation module
- *
- * @returns true if geolocation module(navigator.geolocation object) should be
- * enabled
- * false if geolocation module(navigator.geolocation object) should be
- * disabled
- */
-bool getGeolocationModuleState(const DPL::String& tizenId);
-}
-} // namespace ViewModule
-
-#endif /* VIEW_LOGIC_GEOLOCATION_SUPPORT_H_*/
SERVICE_DATA_TYPE_MIME
};
+#ifdef APP_SCHEME_ENABLED
+char const * const SCHEME_TYPE_APP = "app";
+#endif
char const * const SCHEME_TYPE_FILE = "file";
char const * const SCHEME_TYPE_WIDGET = "widget";
}
std::string scheme(urlcstr, end);
+#ifdef APP_SCHEME_ENABLED
+ if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE && scheme != SCHEME_TYPE_APP) {
+#else
if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE) {
+#endif
LogDebug("scheme doesn't need to localize");
return DPL::OptionalString(inputURI);
}
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_authentication_challenge_support.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_scheme_support.cpp
- ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_geolocation_support_webkit2.cpp
+ ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_geolocation_support.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_usermedia_support.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_web_notification_support.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/bundles/plugin_module_support.cpp
#include "bundle_uri_handling.h"
#include <dpl/log/log.h>
#include <string.h>
+#include <sys/stat.h>
#include <dpl/utils/wrt_global_settings.h>
// For dao creation (widget info fetching)
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
namespace {
char const * const SCHEME_TYPE_FILE = "file";
char const * const SCHEME_TYPE_WIDGET = "widget";
+char const * const SCHEME_TYPE_APP = "app";
char const * const WARP_ERROR_MSG =
"file:///usr/etc/wrt/warp_security_error.msg";
char const * const PARAM_URL = "param:url";
+#ifdef APP_SCHEME_ENABLED
+char const * const ACE_IGNORED_SCHEMA[] = { "file://", "widget://", "app://",
+ "data:", "tel:", "sms:", "mmsto:",
+ "mailto:", 0 };
+#else
char const * const ACE_IGNORED_SCHEMA[] = { "file://", "widget://", "data:",
"tel:", "sms:", "mmsto:", "mailto:",
0 };
+#endif
bool checkWARP(const char *url, const DPL::String& tizenId)
{
DPL::FromUTF8String(std::string(url)));
}
+bool preventSymlink(const std::string & url)
+{
+ if(0 != strncmp(url.c_str(), SCHEME_TYPE_FILE, strlen(SCHEME_TYPE_FILE)))
+ {
+ return true;
+ }
+ if(url.size() >= strlen(SCHEME_TYPE_FILE) + 3)
+ {
+ std::string file = url.substr(strlen(SCHEME_TYPE_FILE) + 3);
+ struct stat st;
+ if(0 != stat(file.c_str(), &st)) return true;
+ return !S_ISLNK(st.st_mode);
+ }
+ else
+ {
+ return true;
+ }
+}
+
bool checkACE(const char* url, bool xhr, const DPL::String& tizenId)
{
if (url) {
auto uri = DPL::ToUTF8String(*op_uri);
if (!checkWARP(uri.c_str(), tizenId)) {
- LogDebug("Request was blocked by WARP: " << uri);
+ LogWarning("Request was blocked by WARP: " << uri);
return false;
}
if (!checkACE(uri.c_str(), is_xhr, tizenId)) {
- LogDebug("Request was blocked by ACE: " << uri);
+ LogWarning("Request was blocked by ACE: " << uri);
+ return false;
+ }
+
+ if (!preventSymlink(uri)) {
+ LogWarning("Request for symlink is invalid: " << uri);
return false;
}
DPL::OptionalString localizeURI(const DPL::String& inputURI,
const DPL::String& tizenId)
{
- auto uri = DPL::ToUTF8String(inputURI);
+ std::string uri = DPL::ToUTF8String(inputURI);
LogDebug("localizing url: " << uri);
-
auto urlcstr = uri.c_str();
-
const char *end = strstr(urlcstr, ":");
if (!end) {
LogDebug("no schema in link, return null");
// lack of schema
return DPL::Optional<DPL::String>::Null;
}
-
std::string scheme(urlcstr, end);
+
+#ifdef APP_SCHEME_ENABLED
+ if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE && scheme != SCHEME_TYPE_APP) {
+#else
if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE) {
+#endif
LogDebug("scheme doesn't need to localize");
return DPL::OptionalString(inputURI);
}
* limitations under the License.
*/
/**
- * @file wrt-wk2-PageGlobalContextContainer.cpp
+ * @file page_global_context_container.cpp
* @author Tomasz Iwanek (t.iwanek@smasung.com)
* @brief Declares container for global context that holds its references
*/
* limitations under the License.
*/
/**
- * @file wrt-wk2-PageGlobalContextContainer.h
+ * @file page_global_context_container.h
* @author Tomasz Iwanek (t.iwanek@smasung.com)
* @brief Declares container for global context that holds its references
*/
#include <WKError.h>
#include <WKURLResponseTizen.h>
#include <WKBundlePagePrivate.h>
+#include <WKBundlePrivate.h>
#include <string>
#include <cstdio>
const char * const URICHANGE_BLOCKED_URL = "null";
const char * const SCHEME_HTTP = "http";
const char * const SCHEME_HTTPS = "https";
-const char * const SCHEME_FILE = "file://";
+const char * const SCHEME_FILE = "file";
+const char * const SCHEME_FILE_SLASH = "file://";
const char * const DATA_STRING = "data:";
const char * const BASE64_STRING = ";base64,";
const char * const BLANK_PAGE_URL = "about:blank";
const unsigned int UID_ROOT = 0;
const unsigned int DEFAULT_PRIORITY = 0;
const char * const PRIVILEGE_APP_TYPE = "wgt";
+#ifdef CORS_WHITELISTING_ENABLED
+const char * const warpAllowProtocolsForWildcard[] = { "http", "https" };
+#endif
static bool m_initWebApp = false;
ByteBuffer *getBuffer = pInstance->_TrustZoneService::DecryptN(*appInfo, pBuf);
return getBuffer;
}
+
}
Bundle::Bundle(WKBundleRef bundle) :
}
}
+#ifdef CORS_WHITELISTING_ENABLED
+void Bundle::bypassCORSforWARPAccessList(WrtDB::WidgetDAOReadOnly & dao)
+{
+ // bypassing CORS using origin whitelist
+ WrtDB::WidgetAccessInfoList WAList;
+ dao.getWidgetAccessInfo(WAList);
+ FOREACH(it, WAList)
+ {
+ const WrtDB::WidgetAccessInfo & access = *it;
+ WKURLRef url = WKURLCreateWithUTF8CString(DPL::ToUTF8String(access.strIRI).c_str());
+
+#ifdef APP_SCHEME_ENABLED
+ std::string source = std::string("app://") + DPL::ToUTF8String(m_widgetTizenId) + "/";
+#else
+ std::string source = DPL::ToUTF8String(dao.getFullPath());
+#endif
+
+ LogDebug("WARP to WK whitelist position: " << source << " for "
+ << access.strIRI << " subDomains: " << access.bSubDomains);
+
+ WKStringRef wkSource = WKStringCreateWithUTF8CString(source.c_str());
+ WKStringRef wkHost;
+ WKStringRef wkProtocol;
+ if(access.strIRI == L"*")
+ {
+ //wildcard force to explicitly say which protocol is used
+ // passed wkHost if empty means wildcard -> allow everything but protocol has to be set.
+ for(unsigned i = 0; i < sizeof(warpAllowProtocolsForWildcard) / sizeof(char*); i++)
+ {
+ wkHost = WKStringCreateWithUTF8CString("");
+ wkProtocol = WKStringCreateWithUTF8CString(warpAllowProtocolsForWildcard[i]);
+ WKBundleAddOriginAccessWhitelistEntry(m_bundle,
+ wkSource, wkProtocol, wkHost, access.bSubDomains);
+ }
+ }
+ else
+ {
+ wkHost = WKURLCopyHostName(url);
+ wkProtocol = WKURLCopyScheme(url);
+ WKBundleAddOriginAccessWhitelistEntry(m_bundle,
+ wkSource, wkProtocol, wkHost, access.bSubDomains);
+ }
+
+ WKRelease(wkHost);
+ WKRelease(wkProtocol);
+ WKRelease(wkSource);
+ }
+}
+#endif
+
void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
{
LogDebug("got message type: " << toString(messageName).c_str());
ssMsg >> argEncodedBundle;
ssMsg >> argTheme;
ssMsg >> m_encrypted;
+ LogWarning("m_encrypted : " << m_encrypted);
// ** Language tags setting completed **
fixWKMessageArgs(argScale, argEncodedBundle, argTheme);
LogDebug("set_app_privilege(" << appPath << ")");
set_app_privilege(tzPkgId.c_str(), PRIVILEGE_APP_TYPE, appPath.c_str());
}
+#ifdef CORS_WHITELISTING_ENABLED
+ bypassCORSforWARPAccessList(dao);
+#endif
/* This type of message is received when widget is restarting
* (proably in other situation too). Widget restart can be
LogDebug("URI processing result: " << *localizedUrl);
std::string tmpUrlStr = DPL::ToUTF8String(*localizedUrl);
WKURLRef tmpUrl = WKURLCreateWithUTF8CString(tmpUrlStr.c_str());
- std::string scheme = toString(WKURLCopyScheme(url));
+ std::string scheme = toString(WKURLCopyScheme(url)); //scheme of original request
WKRelease(url);
+
+#ifdef APP_SCHEME_ENABLED
+ if(scheme == SCHEME_FILE) {
+ LogError("File schema blocked for: " << dplurl);
+ return NULL;
+ }
+#endif
+
// Return value must contain details information of input
// WKURLRequestRef. Current webkit2 doesn't support api that
// copy WKURLRequestRef or change url only. Before webkit2
WrtDB::EncryptedFileInfo info;
std::string filePath;
- if (0 != strncmp(Url.c_str(), SCHEME_FILE, strlen(SCHEME_FILE))) {
+ if (0 != strncmp(Url.c_str(), SCHEME_FILE_SLASH, strlen(SCHEME_FILE_SLASH))) {
return false;
}
- filePath = Url.substr(strlen(SCHEME_FILE));
+ filePath = Url.substr(strlen(SCHEME_FILE_SLASH));
info.fileName = DPL::FromUTF8String(filePath);
if (m_encryptedFiles.end() != (it = m_encryptedFiles.find(info)))
{
std::string filePath;
- size_t pos = resource.find_first_not_of(SCHEME_FILE);
+ size_t pos = resource.find_first_not_of(SCHEME_FILE_SLASH);
if (std::string::npos != pos) {
filePath = resource.substr(pos - 1);
}
void fixWKMessageArgs(std::string & argScale,
std::string & argEncodedBundle,
std::string & argTheme);
+#ifdef CORS_WHITELISTING_ENABLED
+ void bypassCORSforWARPAccessList(WrtDB::WidgetDAOReadOnly &dao);
+#endif
};
#endif /* WRT_SRC_VIEW_WEBKIT2_WRT_WK2_BUNDLE_H_ */
#include <dpl/string.h>
#include <dpl/foreach.h>
+#include <Elementary.h>
#include <pcrecpp.h>
#include <vconf.h>
#include <sysman.h>
#include <common/view_logic_vibration_support.h>
#include <view_logic_authentication_challenge_support.h>
#include <view_logic_scheme_support.h>
-#include <view_logic_geolocation_support_webkit2.h>
+#include <view_logic_geolocation_support.h>
#include <view_logic_usermedia_support.h>
#include <view_logic_web_notification_support.h>
#include <popup-runner/PopupInvoker.h>
#include <EWebKit2.h>
+#include <dpl/localization/w3c_file_localization.h>
#include <js_overlay_types.h>
#include <i_runnable_widget_object.h>
#include <profiling_util.h>
#include <appsvc/appsvc.h>
namespace {
-const char * const bundlePath = "/usr/lib/wrt-wk2-bundles/libwrt-wk2-bundle.so";
const char * const uriBlockedMessageName = "uri_blocked_msg";
const char * const uriChangedMessageName = "uri_changed_msg";
const char * const URICHANGE_PLUGIN_STOP_ONLY = "plugin_stop_only";
const char * const URICHANGE_PLUGIN_RESTART = "plugin_restart";
const char * const URICHANGE_PLUGIN_NO_CHANGE = "plugin_no_change";
-const char * const URICHANGE_BLOCKED_URL = "null";
const char* PATTERN_URI_CHANGE = "^(([^:/\\?#]+)://[^\\?#]*)";
-const int MAX_NUM_CONTEXT_MENU_ITEMS = 10;
+
// IME State value
const char * const IME_STATE_ON = "on";
const char * const IME_STATE_OFF = "off";
const char CONTENT_HANDLER_ASK_MSG[] = "Add content?";
const char CONTENT_HANDLER_ASK_TITLE[] = "Add content";
const char CONTENT_HANDLER_AKS_REMEMBER[] = "Remember dicision";
-const char * const CERTIFICATE_CONFIRM_REQUEST_ASK_TITLE =
- "Certification Info";
-const char * const CERTIFICATE_CONFIRM_REQUEST_ASK_BODY =
- "This site's security certificate is not trusted! Do you acess this site?";
-const wchar_t* BACKGROUND_ENABLED = L"background_enabled";
+const int WIN_ORIENTATION_PORTRAIT_PRIMARY_ANGLE = 0;
+const int WIN_ORIENTATION_PORTRAIT_SECONDARY_ANGLE = 180;
+const int WIN_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE = 270;
+const int WIN_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE = 90;
+const int W3C_ORIENTATION_PORTRAIT_PRIMARY_ANGLE = 0;
+const int W3C_ORIENTATION_PORTRAIT_SECONDARY_ANGLE = 180;
+const int W3C_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE = 90;
+const int W3C_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE = -90;
} // anonymous namespace
std::map<const std::string,
sysman_inform_active(pid);
m_isBackgroundSupport = true;
}
-#ifndef DEPRECATED_SETTING_STRING
- else {
- WrtDB::WidgetDAOReadOnly dao(m_model->TizenId);
- WrtDB::PropertyDAOReadOnly::WidgetPropertyValue bgEnableValue =
- dao.getPropertyValue(DPL::String(BACKGROUND_ENABLED));
-
- if (!bgEnableValue.IsNull() && !bgEnableValue->compare(L"true")) {
- //skip suspendWidget
- LogDebug("Background support enabled, set process active");
- pid_t pid = getpid();
- sysman_inform_active(pid);
- m_isBackgroundSupport = true;
- }
- }
-#endif
-
m_schemeSupport.reset(new SchemeSupport(m_model->Type.Get().appType));
ViewModule::StorageSupport::initializeStorage(m_model);
m_appsSupport->initialize(m_model);
ewk_view_page_visibility_state_set(wkView,
EWK_PAGE_VISIBILITY_STATE_VISIBLE,
EINA_TRUE);
+
+ std::string encoding="UTF-8";
+ OptionalWidgetStartFileInfo fileInfo = W3CFileLocalization::getStartFileInfo(m_model->TizenId);
+ if(!fileInfo.IsNull()){
+ encoding=DPL::ToUTF8String((*fileInfo).encoding);
+ LogInfo("Found custom encoding in DB: " << encoding);
+ }
+ LogInfo("Setting encoding: " << encoding);
+ if(ewk_settings_default_encoding_set(settings,encoding.c_str()))
+ LogInfo("Encoding set properly");
+ else
+ LogInfo("Error while setting encoding");
}
void ViewLogic::removeEwkView(Evas_Object *wkView)
ewk_geolocation_permission_request_set(permissionRequest, EINA_FALSE);
return;
}
- ViewModule::GeolocationSupport::Webkit2::geolocationPermissionRequest(
+ ViewModule::GeolocationSupport::geolocationPermissionRequest(
This->m_window,
This->m_securityOriginSupport->getSecurityOriginDAO(),
eventInfo);
if (orientation & EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY) {
LogDebug("orientation is portrait-primary");
- elm_win_rotation_with_resize_set(This->m_window, 0);
- ewk_view_orientation_send(obj, 0);
+ elm_win_wm_rotation_preferred_rotation_set(
+ This->m_window,
+ WIN_ORIENTATION_PORTRAIT_PRIMARY_ANGLE);
+ ewk_view_orientation_send(obj, W3C_ORIENTATION_PORTRAIT_PRIMARY_ANGLE);
} else if (orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) {
LogDebug("orientation is landscape-primary");
- elm_win_rotation_with_resize_set(This->m_window, 270);
- ewk_view_orientation_send(obj, 90);
+ elm_win_wm_rotation_preferred_rotation_set(
+ This->m_window,
+ WIN_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE);
+ ewk_view_orientation_send(
+ obj,
+ W3C_ORIENTATION_LANDSCAPE_PRIMARY_ANGLE);
} else if (orientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) {
LogDebug("orientation is portrait-secondary");
- elm_win_rotation_with_resize_set(This->m_window, 180);
- ewk_view_orientation_send(obj, 180);
+ elm_win_wm_rotation_preferred_rotation_set(
+ This->m_window,
+ WIN_ORIENTATION_PORTRAIT_SECONDARY_ANGLE);
+ ewk_view_orientation_send(
+ obj,
+ W3C_ORIENTATION_PORTRAIT_SECONDARY_ANGLE);
} else if (orientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) {
LogDebug("orientation is landscape-secondary");
- elm_win_rotation_with_resize_set(This->m_window, 90);
- ewk_view_orientation_send(obj, -90);
+ elm_win_wm_rotation_preferred_rotation_set(
+ This->m_window,
+ WIN_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE);
+ ewk_view_orientation_send(
+ obj,
+ W3C_ORIENTATION_LANDSCAPE_SECONDARY_ANGLE);
} else {
LogDebug("Wrong orientation is set");
return EINA_FALSE;
* limitations under the License.
*/
/**
- * @file view_logic_geolocation_support_webkit2.cpp
+ * @file view_logic_geolocation_support.cpp
* @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
*/
-#include "view_logic_geolocation_support_webkit2.h"
+#include "view_logic_geolocation_support.h"
#include <string>
#include <sstream>
namespace ViewModule {
namespace GeolocationSupport {
-namespace Webkit2 {
using namespace SecurityOriginDB;
using namespace ViewModule::SecurityOriginSupportUtil;
askUserForGeolocationPermission(window, permissionData);
return;
}
-}
} // namespace GeolocationSupport
} // namespace ViewModule
* limitations under the License.
*/
/**
- * @file view_logic_geolocation_support_webkit2.h
+ * @file view_logic_geolocation_support.h
* @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
*/
-#ifndef VIEW_LOGIC_GEOLOCATION_SUPPORT_WEBKIT2_H_
-#define VIEW_LOGIC_GEOLOCATION_SUPPORT_WEBKIT2_H_
+#ifndef VIEW_LOGIC_GEOLOCATION_SUPPORT_H_
+#define VIEW_LOGIC_GEOLOCATION_SUPPORT_H_
#include <memory.h>
#include <Elementary.h>
namespace ViewModule {
namespace GeolocationSupport {
-namespace Webkit2 {
void geolocationPermissionRequest(
Evas_Object* window,
SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
void* data);
-}
} // namespace GeolocationSupport
} // namespace ViewModule
char const * const TIZEN_SCHEME = "tizen";
char const * const TIZEN_EXIT = "tizen://exit";
char const * const TIZEN_HIDE = "tizen://hide";
-char const * const TIZEN_ORIENTATION_LANDSCAPE =
- "tizen://orientation.landscape";
-char const * const TIZEN_ORIENTATION_PORTAIT = "tizen://orientation.portrait";
-char const * const TIZEN_ORIENTATION_RESET = "tizen://orientation.reset";
char const * const TIZEN_CHANGE_USERAGNET = "tizen://changeUA";
-const int ORIENTATION_LANDSCAPE_ANGLE = 270;
-const int ORIENTATION_PORTAIT_ANGLE = 0;
-
-const int W3C_SCREEN_ORI_PORTRAIT_PRIMARY = 0;
-const int W3C_SCREEN_ORI_LANDSCAPE_PRIMARY = 90;
-
static Eina_Bool exitAppIdlerCallback(void* /*data*/)
{
// webapp termination
elm_win_lower(window);
return true;
} else if (strncmp(uri,
- TIZEN_ORIENTATION_LANDSCAPE,
- strlen(TIZEN_ORIENTATION_LANDSCAPE)) == 0)
- {
- LogInfo("Tizen scheme: " << uri << " orientation landscape");
- elm_win_rotation_with_resize_set(window, ORIENTATION_LANDSCAPE_ANGLE);
- ewk_view_orientation_send(wkView, W3C_SCREEN_ORI_LANDSCAPE_PRIMARY);
- return true;
- } else if (strncmp(uri,
- TIZEN_ORIENTATION_PORTAIT,
- strlen(TIZEN_ORIENTATION_PORTAIT)) == 0)
- {
- LogInfo("Tizen scheme: " << uri << " orientation portait");
- elm_win_rotation_with_resize_set(window, ORIENTATION_PORTAIT_ANGLE);
- ewk_view_orientation_send(wkView, W3C_SCREEN_ORI_PORTRAIT_PRIMARY);
- return true;
- } else if (strncmp(uri,
- TIZEN_ORIENTATION_RESET,
- strlen(TIZEN_ORIENTATION_RESET)) == 0)
- {
- LogInfo("Tizen scheme: " << uri << " reset");
- elm_win_rotation_with_resize_set(window, ORIENTATION_PORTAIT_ANGLE);
- ewk_view_orientation_send(wkView, W3C_SCREEN_ORI_PORTRAIT_PRIMARY);
- return true;
- } else if (strncmp(uri,
TIZEN_CHANGE_USERAGNET,
strlen(TIZEN_CHANGE_USERAGNET)) == 0)
{
<manifest>
<define>
- <domain name="wrt" />
- <provide>
- <label name="wrt::wrt-client" />
- <label name="wrt::wrt-launcher" />
- </provide>
+ <domain name="wrt"/>
</define>
+ <assign>
+ <filesystem path="/usr/bin/wrt-launcher" label="wrt-launcher" exec_label="wrt-launcher"/>
+ </assign>
<request>
<domain name="_"/>
</request>