#git:framework/web/wrt
Name: wrt
Summary: web runtime
-Version: 0.8.257
+Version: 0.8.260
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
LicenseHref(this),
//localized, so not binded
Icon(this),
+ Version(this,
+ &BindToWidgetDAO<DPL::OptionalString,
+ &WidgetDAOReadOnly::getVersion>::Get),
SplashImg(
this,
&BindToWidgetDAO<DPL::OptionalString,
DPL::Event::Property<OptionalWidgetIcon> Icon;
/**
+ * @brief Widget version
+ */
+ DPL::Event::Property<DPL::OptionalString,
+ DPL::Event::PropertyReadOnly,
+ DPL::Event::PropertyStorageDynamicCached> Version;
+
+ /**
* @brief Widget splash image src
*/
DPL::Event::Property<DPL::OptionalString,
}
LogDebug("Making ace check with new C-API");
- ace_bool_t result = ACE_FALSE;
- ace_return_t ret = ace_check_access(&aceRequest, &result);
+ ace_check_result_t result = ACE_PRIVILEGE_DENIED;
+ ace_return_t ret = ace_check_access_ex(&aceRequest, &result);
LogDebug("Result is: " << static_cast<int>(result));
delete[] aceRequest.dev_cap_list.items[0].param_list.items;
delete[] aceRequest.dev_cap_list.items;
- return ACE_OK == ret && ACE_TRUE == result;
+ return ACE_OK == ret && ACE_ACCESS_GRANTED == result;
}
} //TODO copied from view_logic.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_message_support.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_orientation_support.cpp
${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_scheme_support.cpp
+ ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_user_agent_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/view_logic_web_storage_support.cpp
* This file handles operation regarding Ewk_Context
*/
+#include <map>
#include <string>
#include <cert-service.h>
#include <vconf.h>
#include "ewk_context_manager.h"
namespace ViewModule {
-
-static const std::string bundlePath("/usr/lib/libwrt-injected-bundle.so");
+namespace {
+const std::string bundlePath("/usr/lib/libwrt-injected-bundle.so");
+std::map<Ewk_Extensible_API, Eina_Bool> defaultExtensibleAPI = {
+ { EWK_EXTENSIBLE_API_MEDIA_STREAM_RECORD, EINA_TRUE },
+ { EWK_EXTENSIBLE_API_ROTATE_CAMERA_VIEW, EINA_FALSE },
+ { EWK_EXTENSIBLE_API_MEDIA_VOLUME_CONTROL, EINA_TRUE },
+};
+} // anonymous namespace
EwkContextManager::EwkContextManager(
const std::string& tizenAppId,
// cache model setting
ewk_context_cache_model_set(
- m_ewkContext,
- EWK_CACHE_MODEL_DOCUMENT_BROWSER);
+ m_ewkContext,
+ EWK_CACHE_MODEL_DOCUMENT_BROWSER);
ADD_PROFILING_POINT("WebProcess fork", "start");
// To fork a Webprocess as soon as possible,
// the following ewk_api is called explicitly.
LogError("cert path is null");
}
- ewk_context_tizen_extensible_api_set(
- m_ewkContext,
- EWK_EXTENSIBLE_API_MEDIA_STREAM_RECORD,
- EINA_TRUE);
- ewk_context_tizen_extensible_api_set(
- m_ewkContext,
- EWK_EXTENSIBLE_API_ROTATE_CAMERA_VIEW,
- EINA_FALSE);
- ewk_context_tizen_extensible_api_set(
- m_ewkContext,
- EWK_EXTENSIBLE_API_MEDIA_VOLUME_CONTROL,
- EINA_TRUE);
-
+ FOREACH(it, defaultExtensibleAPI) {
+ ewk_context_tizen_extensible_api_set(m_ewkContext,
+ it->first,
+ it->second);
+ }
// web application dependent settings
WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId));
aceRequest.dev_cap_list.items[0].param_list.items[0].value =
const_cast<ace_string_t>(url);
- ace_bool_t result = ACE_FALSE;
-
- ace_return_t ret = ace_check_access(&aceRequest, &result);
+ ace_check_result_t result = ACE_PRIVILEGE_DENIED;
+ ace_return_t ret = ace_check_access_ex(&aceRequest, &result);
_D("Result is: %d", static_cast<int>(result));
delete[] aceRequest.dev_cap_list.items[0].param_list.items;
delete[] aceRequest.dev_cap_list.items;
- return ACE_OK == ret && ACE_TRUE == result;
+ return ACE_OK == ret && ACE_ACCESS_GRANTED == result;
}
} // namespace (anonymous)
#include <view_logic_message_support.h>
#include <view_logic_orientation_support.h>
#include <view_logic_scheme_support.h>
+#include <view_logic_user_agent_support.h>
#include <view_logic_usermedia_support.h>
#include <view_logic_web_notification_support.h>
#include <view_logic_web_storage_support.h>
#include <popup-runner/PopupInvoker.h>
#include <plugins-ipc-message/ipc_message_support.h>
#include <appsvc.h>
+
namespace {
// IME State value
const char * const IME_STATE_ON = "on";
{
LogDebug("prepareEwkView called");
Assert(wkView);
- Ewk_Settings* settings = ewk_view_settings_get(wkView);
+ ViewModule::UserAgentSupport::setUserAgent(m_model, wkView);
- // set user agent
- std::string customUserAgent = m_model->SettingList.Get().getUserAgent();
- if (customUserAgent.empty()) {
- LogDebug("Setting user agent as: default");
- ewk_view_user_agent_set(wkView, NULL);
- std::string defaultUA = ewk_view_user_agent_get(wkView);
- LogDebug("webkit's UA: " << defaultUA);
- } else {
- LogDebug("Setting custom user agent as: " << customUserAgent);
- ewk_view_user_agent_set(wkView, customUserAgent.c_str());
- }
+ Ewk_Settings* settings = ewk_view_settings_get(wkView);
// set custom header : language
using namespace ViewModule::CustomHeaderSupport;
--- /dev/null
+/*
+ * Copyright (c) 2013 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_user_agent_support.cpp
+ * @author Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+
+#include "view_logic_user_agent_support.h"
+
+#include <string>
+#include <cstring>
+#include <dpl/log/secure_log.h>
+#include <dpl/string.h>
+#include <widget_model.h>
+
+#include <app.h>
+#include <Elementary.h>
+#include <EWebKit2.h>
+
+namespace ViewModule {
+namespace {
+void setCustomUA(std::string customUA);
+bool setAppInfo(WidgetModel* model, Evas_Object* wkView);
+void printUA(Evas_Object* wkView);
+
+bool setCustomUA(WidgetModel* model, Evas_Object* wkView)
+{
+ std::string customUserAgent = model->SettingList.Get().getUserAgent();
+ if (customUserAgent.empty()) {
+ return false;
+ } else {
+ ewk_view_user_agent_set(wkView, customUserAgent.c_str());
+ return true;
+ }
+ return false;
+}
+
+bool setAppInfo(WidgetModel* model, Evas_Object* wkView)
+{
+ std::string appInfo; // appname/appversion
+ char* name = NULL;
+ if (app_get_name(&name) == APP_ERROR_NONE) {
+ appInfo = name;
+ free(name);
+ } else {
+ _W("Fail to get app name");
+ if (name) {
+ free(name);
+ }
+ return false;
+ }
+
+ DPL::OptionalString version = model->Version.Get();
+ if (!version.IsNull()) {
+ std::string versionStr = DPL::ToUTF8String(*version);
+ if (versionStr.empty()) {
+ // version is empty
+ // skip to set version field
+ } else {
+ appInfo += "/";
+ appInfo += versionStr;
+ }
+ }
+ if (ewk_view_application_name_for_user_agent_set(wkView, appInfo.c_str())
+ == EINA_TRUE)
+ {
+ // verify
+ const char* info =
+ ewk_view_application_name_for_user_agent_get(wkView);
+ if (!info || !strlen(info) || appInfo != info) {
+ _W("Fail to verify app info in the UA");
+ return false;
+ }
+ return true;
+ } else {
+ _W("Fail to set app info to UA");
+ return false;
+ }
+}
+
+void printUA(Evas_Object* wkView)
+{
+ const char* ua = ewk_view_user_agent_get(wkView);
+ _D("%s", ua);
+}
+} // anonymous namespace
+
+void UserAgentSupport::setUserAgent(WidgetModel* model, Evas_Object* wkView)
+{
+ Assert(model);
+ Assert(wkView);
+
+ // set custom UA
+ if (setCustomUA(model, wkView)) {
+ printUA(wkView);
+ return;
+ }
+
+ // In case of default UA, add appname/appversion
+ if (setAppInfo(model, wkView)) {
+ printUA(wkView);
+ } else {
+ // default UA
+ printUA(wkView);
+ }
+ return;
+}
+
+} // ViewModule
--- /dev/null
+/*
+ * Copyright (c) 2013 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_user_agent_support.h
+ * @author Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+
+#ifndef VIEW_LOGIC_USER_AGENT_SUPPORT_H_
+#define VIEW_LOGIC_USER_AGENT_SUPPORT_H_
+
+#include <Elementary.h>
+
+class WidgetModel;
+
+namespace ViewModule {
+namespace UserAgentSupport {
+void setUserAgent(WidgetModel* model, Evas_Object* wkView);
+} // namespace UserAgentSupport
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_USER_AGENT_SUPPORT_H_
\ No newline at end of file
Evas_Object* imageObject = elm_image_object_get(m_splashScreen);
- if (ratio_image < ratio_win)
+ if (ratio_image <= ratio_win)
{
evas_object_image_fill_set(imageObject, 0, 0-((scaled_image_h-h)/2), scaled_image_w, scaled_image_h);
evas_object_reposition(imageObject, x, y, w, h);
else
{
evas_object_image_fill_set(imageObject, 0, 0, scaled_image_w, scaled_image_h);
- evas_object_reposition(imageObject, 0, (h-scaled_image_h)/2, scaled_image_w, scaled_image_h);
+ evas_object_reposition(imageObject, 0, y+(h-scaled_image_h)/2, scaled_image_w, scaled_image_h);
}
m_initialized = true;
Evas_Object* imageObject = elm_image_object_get(m_splashScreen);
- if (ratio_image < ratio_win)
+ if (ratio_image <= ratio_win)
{
evas_object_image_fill_set(imageObject, 0, 0-((scaled_image_h-h)/2), scaled_image_w, scaled_image_h);
evas_object_reposition(imageObject, x, y, w, h);
else
{
evas_object_image_fill_set(imageObject, 0, 0, scaled_image_w, scaled_image_h);
- evas_object_reposition(imageObject, 0, (h-scaled_image_h)/2, scaled_image_w, scaled_image_h);
+ evas_object_reposition(imageObject, 0, y+(h-scaled_image_h)/2, scaled_image_w, scaled_image_h);
}
}
#include <efl_assist_screen_reader.h>
namespace {
+const char* const DELETE_REQUEST = "delete,request";
const char* const PROFILE_CHANGED = "profile,changed";
const char* const DESKTOP_ICON_PATH =
"/opt/share/icons/default/small/tizenScmgz.png";
int w, h;
ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
evas_object_resize(window, w, h);
-
+ elm_win_autodel_set(window, EINA_TRUE);
+ evas_object_smart_callback_add(window,
+ DELETE_REQUEST,
+ winDeleteRequestCallback,
+ this);
evas_object_smart_callback_add(window,
PROFILE_CHANGED,
winProfileChangedCallback,
This->m_ctxpopup = NULL;
}
+void WindowData::winDeleteRequestCallback(void* data,
+ Evas_Object* /*obj*/,
+ void* /*eventInfo*/)
+{
+ LogDebug("call");
+ elm_exit();
+}
+
void WindowData::winProfileChangedCallback(void *data,
Evas_Object* /*obj*/,
void* /*eventInfo*/)
static void ctxpopupDismissedCallback(void* data,
Evas_Object* obj,
void* eventInfo);
+ static void winDeleteRequestCallback(void* data,
+ Evas_Object* obj,
+ void* eventInfo);
static void winProfileChangedCallback(void* data,
Evas_Object* obj,
void* eventInfo);
void set_env()
{
- // set evas backend type
- if (!getenv("ELM_ENGINE"))
- {
- if (!setenv("ELM_ENGINE", "gl", 1))
- {
- LogDebug("Enable backend");
- }
- }
- else
- {
- LogDebug("ELM_ENGINE : " << getenv("ELM_ENGINE"));
- }
-
+ elm_config_preferred_engine_set("opengl_x11");
#ifndef TIZEN_PUBLIC
setenv("COREGL_FASTPATH", "1", 1);
#endif