From f07ceeb6d5c57638b3ccf970ac96b9102d526feb Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Tue, 9 Jul 2013 22:41:21 +0900 Subject: [PATCH] [Release] wrt_0.8.235 Change-Id: I2772ea94902f10452eb2e5945f01fd205ac57ee8 --- data/Daemon.edc | 2 +- packaging/wrt.spec | 4 +- src/domain/widget_data_types.h | 5 + src/view/common/view_logic_apps_support.cpp | 10 -- src/view/webkit/CMakeLists.txt | 2 + .../webkit/injected-bundle/wrt-injected-bundle.cpp | 33 +++++++ src/view/webkit/view_logic.cpp | 105 +++++++++++++++------ src/view/webkit/view_logic.h | 3 +- src/wrt-client/splash_screen_support.cpp | 56 +++++++---- src/wrt-client/splash_screen_support.h | 2 + src/wrt-client/window_data.cpp | 6 +- src/wrt-client/window_data.h | 1 + src/wrt-client/wrt-client.cpp | 4 +- 13 files changed, 167 insertions(+), 66 deletions(-) diff --git a/data/Daemon.edc b/data/Daemon.edc index 4a2ac70..77467a0 100644 --- a/data/Daemon.edc +++ b/data/Daemon.edc @@ -291,7 +291,7 @@ collections { color: 0 0 0 255; align: 0.0 0.5; rel1 { - relative: 0.0 0.0; + relative: 0.10 0.0; to: "pad_b"; } rel2 { diff --git a/packaging/wrt.spec b/packaging/wrt.spec index 46184ee..fbb0f35 100644 --- a/packaging/wrt.spec +++ b/packaging/wrt.spec @@ -1,7 +1,7 @@ #git:framework/web/wrt Name: wrt Summary: web runtime -Version: 0.8.233 +Version: 0.8.235 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 @@ -42,12 +42,14 @@ BuildRequires: pkgconfig(haptic) BuildRequires: pkgconfig(capi-web-url-download) BuildRequires: pkgconfig(wrt-plugin-loading) BuildRequires: pkgconfig(wrt-plugin-js-overlay) +BuildRequires: pkgconfig(wrt-plugins-ipc-message) BuildRequires: pkgconfig(wrt-popup-wrt-runner) BuildRequires: pkgconfig(wrt-popup-ace-runner) BuildRequires: pkgconfig(sysman) BuildRequires: pkgconfig(app2sd) BuildRequires: pkgconfig(capi-system-system-settings) BuildRequires: pkgconfig(libsmack) +BuildRequires: pkgconfig(efl-assist) BuildRequires: libss-client-devel BuildRequires: gettext BuildRequires: edje-tools diff --git a/src/domain/widget_data_types.h b/src/domain/widget_data_types.h index 26f4842..6e7a87e 100644 --- a/src/domain/widget_data_types.h +++ b/src/domain/widget_data_types.h @@ -275,4 +275,9 @@ const int UNLOCK = -1; } // namespace Window } // namespace OrientationAngle +namespace KeyName { +const std::string BACK = "back"; +const std::string MENU = "menu"; +} // KeyName + #endif /* WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_ */ diff --git a/src/view/common/view_logic_apps_support.cpp b/src/view/common/view_logic_apps_support.cpp index 4e07b7a..6b66482 100644 --- a/src/view/common/view_logic_apps_support.cpp +++ b/src/view/common/view_logic_apps_support.cpp @@ -77,16 +77,6 @@ class AppsSupportImplementation service_set_operation(serviceHandle, SERVICE_OPERATION_VIEW); service_set_mime(serviceHandle, mimeType.c_str()); service_set_uri(serviceHandle, uri.c_str()); - } else if (!strcasecmp(mimeType.c_str(), "video/mp4") || - !strcasecmp(mimeType.c_str(), "vidoe/3gp")) - { - CONTROLLER_POST_EVENT( - ApplicationLauncher, - ApplicationLauncherEvents::LaunchApplicationByPkgname( - ApplicationLauncherPkgname::PKG_NAME_VIDEO_PLAYER, - SCHEME_TYPE_HTML5_VIDEO, - uri, - "null")); } else { LogInfo("Not Supported MIME type in WRT"); service_destroy(serviceHandle); diff --git a/src/view/webkit/CMakeLists.txt b/src/view/webkit/CMakeLists.txt index 66d9de1..cbbbf3e 100644 --- a/src/view/webkit/CMakeLists.txt +++ b/src/view/webkit/CMakeLists.txt @@ -27,6 +27,7 @@ PKG_CHECK_MODULES(VIEW_MODULE_DEP notification wrt-commons-custom-handler-dao-rw wrt-dispatch-event + wrt-plugins-ipc-message wrt-plugin-js-overlay wrt-popup-wrt-runner security-core @@ -34,6 +35,7 @@ PKG_CHECK_MODULES(VIEW_MODULE_DEP haptic sysman capi-system-system-settings + efl-assist REQUIRED ) diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp index 9ddd6d4..bd13d0b 100644 --- a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp +++ b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp @@ -532,6 +532,39 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody) m_viewmodesSupport->enterViewmodesAllPages(msgBody); } } + else if (WKStringIsEqualToUTF8CString(messageName, IPCMessageSupport::REPLY_ASYNC)) + { + using namespace IPCMessageSupport; + + std::string msgBody = toString(static_cast(messageBody)); + + if (msgBody.find_first_of('_') != std::string::npos) + { + std::string strHandle = msgBody.substr(0, msgBody.find_first_of('_')); + std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1); + + LogDebug("handle: " << strHandle << ", Body:" << strBody); + + int handle = atoi(strHandle.c_str()); + + AsyncConnectionPtr connection = AsyncConnectionManager::instance().getConnection(handle); + + if (connection) + { + if (connection->replyCallback) + { + LogDebug("connection->replyCallback()"); + (connection->replyCallback)(handle, connection->data, strBody.c_str()); + } + + AsyncConnectionManager::instance().removeConnection(handle); + } + else + { + LogDebug("Connection is not available. Ignored."); + } + } + } } WKURLRequestRef Bundle::willSendRequestForFrameCallback( diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index d32b485..9dd358d 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -70,6 +71,7 @@ #include #include #include +#include #include #include @@ -561,6 +563,45 @@ void ViewLogic::checkAsyncMessageFromBundle(const char* name, const char* body) } ewk_cookie_manager_cookies_clear(cookieManager); } + else if (!strcmp(name, IPCMessageSupport::TIZEN_CHANGE_USERAGENT)) + { + std::string msgBody = (body) ? (body) : ""; + + std::string strId = msgBody.substr(0, msgBody.find_first_of('_')); + std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1); + + LogDebug("Id: " << strId << ", Body:" << strBody); + + ewk_view_user_agent_set(m_currentEwkView, strBody.c_str()); + + LogDebug("get UA: " << ewk_view_user_agent_get(m_currentEwkView)); + + IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "success"); + + return; + } + else if (!strcmp(name, IPCMessageSupport::TIZEN_DELETE_ALL_COOKIES)) + { + std::string msgBody = (body) ? (body) : ""; + + std::string strId = msgBody.substr(0, msgBody.find_first_of('_')); + std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1); + + Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(m_ewkContext); + + if (!cookieManager) + { + LogError("Fail to get cookieManager"); + IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "error"); + + return; + } + ewk_cookie_manager_cookies_clear(cookieManager); + + IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "success"); + + return; + } } void ViewLogic::downloadData(const char* url) @@ -655,11 +696,14 @@ void ViewLogic::ewkClientInit(Evas_Object *wkView) wkView, exceededLocalFileSystemQuotaCallback, this); - evas_object_event_callback_add( - wkView, - EVAS_CALLBACK_KEY_UP, - keyupCallback, - this); + ea_object_event_callback_add(wkView, + EA_CALLBACK_BACK, + eaKeyCallback, + this); + ea_object_event_callback_add(wkView, + EA_CALLBACK_MORE, + eaKeyCallback, + this); } void ViewLogic::ewkClientDeinit(Evas_Object *wkView) @@ -678,9 +722,12 @@ void ViewLogic::ewkClientDeinit(Evas_Object *wkView) ewk_view_exceeded_database_quota_callback_set(wkView, NULL, NULL); ewk_view_exceeded_indexed_database_quota_callback_set(wkView, NULL, NULL); ewk_view_exceeded_local_file_system_quota_callback_set(wkView, NULL, NULL); - evas_object_event_callback_del(wkView, - EVAS_CALLBACK_KEY_UP, - keyupCallback); + ea_object_event_callback_del(wkView, + EA_CALLBACK_BACK, + eaKeyCallback); + ea_object_event_callback_del(wkView, + EA_CALLBACK_MORE, + eaKeyCallback); if (m_orientationThresholdTimer) { ecore_timer_del(m_orientationThresholdTimer); m_orientationThresholdTimer = NULL; @@ -1985,36 +2032,32 @@ void ViewLogic::didRunJavaScriptCallback( LogInfo("result = " << result); } -void ViewLogic::keyupCallback(void* data, - Evas* /*e*/, - Evas_Object* obj, - void* eventInfo) +void ViewLogic::eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo) { Assert(data); ViewLogic* This = static_cast(data); - Assert(eventInfo); - Evas_Event_Key_Up* keyEvent = - static_cast(eventInfo); + Ea_Callback_Type keyType = + static_cast(reinterpret_cast(eventInfo)); - LogInfo("Key = [" << keyEvent->keyname << "]"); - if (!strcmp(keyEvent->keyname, KEY_BACK)) { - if (This->m_model->SettingList.Get().getHWkeyEvent() == - HWkeyEvent_Enable) - { - DispatchEventSupport::dispatchHwKeyEvent(obj, "back"); - } - This->m_cbs->hwkey("back"); - } else if (!strcmp(keyEvent->keyname, KEY_MENU)) { - if (This->m_model->SettingList.Get().getHWkeyEvent() == - HWkeyEvent_Enable) - { - DispatchEventSupport::dispatchHwKeyEvent(obj, "menu"); - } - This->m_cbs->hwkey("menu"); + LogInfo("Key = [" << keyType << "]"); + + std::string keyName; + if (keyType == EA_CALLBACK_BACK) { + keyName = KeyName::BACK; + } else if (keyType == EA_CALLBACK_MORE) { + keyName = KeyName::MENU; + } else { + return; } - return; + if (This->m_model->SettingList.Get().getHWkeyEvent() == HWkeyEvent_Enable) + { + DispatchEventSupport::dispatchHwKeyEvent(obj, keyName); + } + This->m_cbs->hwkey(keyName); + + return; } Eina_Bool ViewLogic::windowCloseIdlerCallback(void* data) diff --git a/src/view/webkit/view_logic.h b/src/view/webkit/view_logic.h index 3826a7e..ca75e06 100644 --- a/src/view/webkit/view_logic.h +++ b/src/view/webkit/view_logic.h @@ -287,8 +287,7 @@ class ViewLogic : public ViewModule::IViewModule void* userData); // event callback - static void keyupCallback(void* data, - Evas* e, + static void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo); diff --git a/src/wrt-client/splash_screen_support.cpp b/src/wrt-client/splash_screen_support.cpp index 2b0cfcb..a898cee 100644 --- a/src/wrt-client/splash_screen_support.cpp +++ b/src/wrt-client/splash_screen_support.cpp @@ -40,6 +40,8 @@ SplashScreenSupport::SplashScreenSupport(Evas_Object* parent, const char* image_ m_timer(NULL), m_deviceWidth(0), m_deviceHeight(0), + m_imageWidth(0), + m_imageHeight(0), m_initialized(false), m_isShowing(false), m_indicator(indicator) @@ -57,6 +59,7 @@ SplashScreenSupport::SplashScreenSupport(Evas_Object* parent, const char* image_ evas_object_color_set(m_splashScreenBg, 255, 255, 255, 255); m_splashScreen = elm_image_add(m_splashScreenBg); + elm_image_no_scale_set(m_splashScreen, FALSE); if (elm_image_file_set(m_splashScreen, image_path, NULL)) { @@ -98,25 +101,39 @@ SplashScreenSupport::SplashScreenSupport(Evas_Object* parent, const char* image_ } // fit to width - int image_w, image_h; - elm_image_object_size_get (m_splashScreen, &image_w, &image_h); + elm_image_object_size_get(m_splashScreen, &m_imageWidth, &m_imageHeight); + + if (m_imageWidth == 0 || m_imageHeight == 0) + { + LogError("Splash screen image size error!"); + + m_imageWidth = w; + m_imageHeight = h; + } double ratio_win = (double)w/h; - double ratio_image = (double)image_w/image_h; + double ratio_image = (double)m_imageWidth/m_imageHeight; + + // set evas position + evas_object_reposition(m_splashScreenBg, x, y, w, h); + evas_object_reposition(m_splashScreen, x, y, w, h); + + double scaled_image_w = w; + double scaled_image_h = (w/ratio_image); + + Evas_Object* imageObject = elm_image_object_get(m_splashScreen); if (ratio_image < ratio_win) { - elm_image_fill_outside_set (m_splashScreen, EINA_TRUE); + 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 { - elm_image_fill_outside_set (m_splashScreen, EINA_FALSE); + 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); } - // set evas position - evas_object_reposition(m_splashScreenBg, x, y, w, h); - evas_object_reposition(m_splashScreen, x, y, w, h); - m_initialized = true; } } @@ -258,22 +275,27 @@ void SplashScreenSupport::resizeSplashScreen() } // fit to width - int image_w, image_h; - elm_image_object_size_get(m_splashScreen, &image_w, &image_h); - double ratio_win = (double)w/h; - double ratio_image = (double)image_w/image_h; + double ratio_image = (double)m_imageWidth/m_imageHeight; + + evas_object_reposition(m_splashScreenBg, x, y, w, h); + evas_object_reposition(m_splashScreen, x, y, w, h); + + double scaled_image_w = w; + double scaled_image_h = (w/ratio_image); + + Evas_Object* imageObject = elm_image_object_get(m_splashScreen); if (ratio_image < ratio_win) { - elm_image_fill_outside_set (m_splashScreen, EINA_TRUE); + 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 { - elm_image_fill_outside_set (m_splashScreen, EINA_FALSE); + 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(m_splashScreenBg, x, y, w, h); - evas_object_reposition(m_splashScreen, x, y, w, h); } } diff --git a/src/wrt-client/splash_screen_support.h b/src/wrt-client/splash_screen_support.h index 6307938..553b863 100644 --- a/src/wrt-client/splash_screen_support.h +++ b/src/wrt-client/splash_screen_support.h @@ -46,6 +46,8 @@ class SplashScreenSupport int m_deviceWidth; int m_deviceHeight; + int m_imageWidth; + int m_imageHeight; bool m_initialized; bool m_isShowing; diff --git a/src/wrt-client/window_data.cpp b/src/wrt-client/window_data.cpp index 1be14b6..4ed50e0 100644 --- a/src/wrt-client/window_data.cpp +++ b/src/wrt-client/window_data.cpp @@ -58,7 +58,8 @@ WindowData::WindowData(unsigned long pid, bool manualInit) : m_floatBackButton(NULL), m_progressbar(NULL), m_ctxpopup(NULL), - m_initialized(false) + m_initialized(false), + m_currentViewModeFullScreen(false) { m_win = createWindow(pid); @@ -133,6 +134,7 @@ void WindowData::setViewMode( LogDebug("fullscreen: " << fullscreen); LogDebug("backbutton: " << backbutton); + m_currentViewModeFullScreen = fullscreen; toggleIndicator(fullscreen); } @@ -392,7 +394,7 @@ void WindowData::emitSignalForUserLayout( void WindowData::toggleFullscreen(bool fullscreen) { LogDebug(__PRETTY_FUNCTION__); - toggleIndicator(fullscreen); + toggleIndicator(fullscreen || m_currentViewModeFullScreen); } void WindowData::winProfileChangedCallback(void *data, diff --git a/src/wrt-client/window_data.h b/src/wrt-client/window_data.h index 44e5eeb..a9e831d 100644 --- a/src/wrt-client/window_data.h +++ b/src/wrt-client/window_data.h @@ -121,6 +121,7 @@ class WindowData : private DPL::Noncopyable Evas_Object* m_progressbar; Evas_Object* m_ctxpopup; bool m_initialized; + bool m_currentViewModeFullScreen; CtxpopupItemDataList m_ctxpopupItemDataList; Evas_Object* createWindow(unsigned long pid); diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index 4adfc48..e58677e 100644 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -840,9 +840,9 @@ void WrtClient::hwkeyCallback(const std::string& key) if (m_settingList->getBackButtonPresence() == BackButton_Enable || m_currentViewMode == VIEWMODE_TYPE_WINDOWED) { - if (key == "back") { + if (key == KeyName::BACK) { m_widget->Backward(); - } else if (key == "menu") { + } else if (key == KeyName::MENU) { // UX isn't confirmed // m_windowData->showCtxpopup(); } -- 2.7.4