From 28d7e3ffb4345e8e923c5e2e664db48c08baf30f Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Thu, 26 Jan 2017 15:21:07 +0900 Subject: [PATCH 01/16] Implement notification onclick event This CL enables notification onclick event. Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2866 Change-Id: Iecb07daaacea6d82abc2824cabcc9941c33f70d1 Signed-off-by: Youngsoo Choi --- runtime/browser/notification_manager.cc | 37 +++++++++++++++++++++++++++++---- runtime/browser/notification_manager.h | 1 + 2 files changed, 34 insertions(+), 4 deletions(-) mode change 100644 => 100755 runtime/browser/notification_manager.h diff --git a/runtime/browser/notification_manager.cc b/runtime/browser/notification_manager.cc index aebd6e4..cff02ad 100755 --- a/runtime/browser/notification_manager.cc +++ b/runtime/browser/notification_manager.cc @@ -22,6 +22,7 @@ #include #include "common/logger.h" +#include "EWebKit_internal.h" namespace runtime { @@ -33,6 +34,26 @@ NotificationManager* NotificationManager::GetInstance() { NotificationManager::NotificationManager() { } +static void notification_onclick_event_cb( + notification_h noti, int event_type, void* userdata) { + NotificationManager* thiz = + static_cast(userdata); + int notification_priv_id = NOTIFICATION_PRIV_ID_NONE; + int ret = notification_get_id(noti, nullptr, ¬ification_priv_id); + if (ret != NOTIFICATION_ERROR_NONE) + LOGGER(ERROR) << "Can't get notification ID" << ret; + ewk_notification_clicked(thiz->FindNotificationID(notification_priv_id)); +} + +uint64_t NotificationManager::FindNotificationID( + int notification_priv_id) { + for (auto it = keymapper_.begin(); it != keymapper_.end(); it++) + if (it->second == notification_priv_id) + return it->first; + LOGGER(ERROR) << "Can't find notification ID" << notification_priv_id; + return 0; +} + bool NotificationManager::Show(uint64_t tag, const std::string& title, const std::string& body, @@ -93,13 +114,21 @@ bool NotificationManager::Show(uint64_t tag, } // insert notification - int platform_key = NOTIFICATION_PRIV_ID_NONE; - ret = notification_insert(noti_h, &platform_key); + ret = notification_post_with_event_cb( + noti_h, notification_onclick_event_cb, this); + if (ret != NOTIFICATION_ERROR_NONE) { + LOGGER(ERROR) << "Can't insert notification " << ret; + return false; + } + + int notification_priv_id = NOTIFICATION_PRIV_ID_NONE; + + ret = notification_get_id(noti_h, nullptr, ¬ification_priv_id); if (ret != NOTIFICATION_ERROR_NONE) { - LOGGER(ERROR) << "Can't insert notification"; + LOGGER(ERROR) << "Can't get notification ID" << ret; return false; } - keymapper_[tag] = platform_key; + keymapper_[tag] = notification_priv_id; return true; } diff --git a/runtime/browser/notification_manager.h b/runtime/browser/notification_manager.h old mode 100644 new mode 100755 index da93524..da703bc --- a/runtime/browser/notification_manager.h +++ b/runtime/browser/notification_manager.h @@ -30,6 +30,7 @@ class NotificationManager { const std::string& body, const std::string& icon_path); bool Hide(uint64_t tag); + uint64_t FindNotificationID(int notification_priv_id); private: NotificationManager(); std::map keymapper_; -- 2.7.4 From 3f570dca62b5d3dfe9f72ef598bc7951381adf2d Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Thu, 26 Jan 2017 15:32:15 +0900 Subject: [PATCH 02/16] Apply session counter only for product tv There hasn't been any issue on public profiles regarding session count. So, the session counter is not needed for the public profiles. Also this CL adds the codes for preventing white screen issue during the termination of web application. Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2867 Change-Id: I2418669eb7000f57d56fdca27437a11e5d59d09b Signed-off-by: Youngsoo Choi Signed-off-by: Youngcheol Kang --- packaging/crosswalk-tizen.spec | 3 +++ runtime/browser/web_application.cc | 8 ++++++++ runtime/runtime.gyp | 3 +++ 3 files changed, 14 insertions(+) diff --git a/packaging/crosswalk-tizen.spec b/packaging/crosswalk-tizen.spec index b1f452b..e908515 100755 --- a/packaging/crosswalk-tizen.spec +++ b/packaging/crosswalk-tizen.spec @@ -115,6 +115,9 @@ GYP_OPTIONS="$GYP_OPTIONS -Dextension_path=%{extension_path}" # Injected bundle GYP_OPTIONS="$GYP_OPTIONS -Dinjected_bundle_path=%{injected_bundle_path}" +# Tizen product tv +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_product_tv=%{!?TIZEN_PRODUCT_TV:0}" + # Build ./tools/gyp/gyp $GYP_OPTIONS xwalk_tizen.gyp ninja -C out/Default %{?_smp_mflags} diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 6c6688d..085af1e 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -758,6 +758,12 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { auto extension_server = XWalkExtensionServer::GetInstance(); LOGGER(DEBUG) << "Shutdown extension server"; extension_server->Shutdown(); +#if !defined(TIZEN_PRODUCT_TV) + // Hide the window object for preventing the white screen + // during termination of web application. + evas_object_hide(window_->evas_object()); + Exit(); +#endif } else if (current != view_stack_.front()) { view_stack_.front()->SetVisibility(true); window_->SetContent(view_stack_.front()->evas_object()); @@ -792,6 +798,7 @@ void WebApplication::OnClosedWebView(WebView* view) { view->ReplyToJavascriptDialog(); RemoveWebViewFromStack(view); +#if defined(TIZEN_PRODUCT_TV) LOGGER(DEBUG) << "plugin_session_count : " << XWalkExtensionRendererController::plugin_session_count; @@ -804,6 +811,7 @@ void WebApplication::OnClosedWebView(WebView* view) { CheckPluginSession, &session_counter); if (!session_counter.timer) LOGGER(ERROR) << "It's failed to create session_counter timer"; +#endif } void WebApplication::OnReceivedWrtMessage(WebView* view, diff --git a/runtime/runtime.gyp b/runtime/runtime.gyp index a818470..4348b5f 100755 --- a/runtime/runtime.gyp +++ b/runtime/runtime.gyp @@ -76,6 +76,9 @@ ['profile == "tv"', { 'defines': ['PROFILE_TV'], }], + ['tizen_product_tv == "1"', { + 'defines': ['TIZEN_PRODUCT_TV'], + }], ['tizen_model_formfactor == "circle"', { 'defines': ['MODEL_FORMFACTOR_CIRCLE'], }], -- 2.7.4 From c332d2771236dd6c0b31483d35b3efea1346af9c Mon Sep 17 00:00:00 2001 From: Youngcheol Kang Date: Thu, 2 Feb 2017 10:17:27 +0900 Subject: [PATCH 03/16] fixup! Refactor call of terminator This patch fixes the following build problem in original patch. error: watch_app_exit was not declared in this scope watch_app_exit(); Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2906 Change-Id: Iaa9028fe0851a0fd8f93d29d779e92a1ef7a56e2 Signed-off-by: Youngcheol Kang --- runtime/browser/web_application.cc | 1 + runtime/runtime.gyp | 1 + 2 files changed, 2 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 085af1e..f6efe80 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -17,6 +17,7 @@ #include "runtime/browser/web_application.h" #include +#include #include #include #include diff --git a/runtime/runtime.gyp b/runtime/runtime.gyp index 4348b5f..3f5ea2e 100755 --- a/runtime/runtime.gyp +++ b/runtime/runtime.gyp @@ -52,6 +52,7 @@ ], 'variables': { 'packages': [ + 'appcore-watch', 'capi-appfw-application', 'capi-ui-efl-util', 'chromium-efl', -- 2.7.4 From b56b1cfcb9d2aa23ca643643346d2965d2269c99 Mon Sep 17 00:00:00 2001 From: Youngcheol Kang Date: Thu, 2 Feb 2017 11:41:25 +0900 Subject: [PATCH 04/16] fixup! fixup! Refactor call of terminator This patch fixes the following build problem in original patch. error : No package 'appcore-watch' found Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2906 Change-Id: I31ec4f3654f800944f2c3af8478f08d65c73d5fe Signed-off-by: Youngcheol Kang --- runtime/browser/web_application.cc | 5 ++++- runtime/runtime.gyp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index f6efe80..ac93129 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -17,7 +17,6 @@ #include "runtime/browser/web_application.h" #include -#include #include #include #include @@ -29,6 +28,10 @@ #include #include +#ifdef WATCH_FACE_FEATURE_SUPPORT +#include +#endif + #include "common/application_data.h" #include "common/app_db.h" #include "common/app_control.h" diff --git a/runtime/runtime.gyp b/runtime/runtime.gyp index 3f5ea2e..4348b5f 100755 --- a/runtime/runtime.gyp +++ b/runtime/runtime.gyp @@ -52,7 +52,6 @@ ], 'variables': { 'packages': [ - 'appcore-watch', 'capi-appfw-application', 'capi-ui-efl-util', 'chromium-efl', -- 2.7.4 From fa25489141a3544101adfa8db98c275c505d13cd Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Mon, 6 Feb 2017 12:47:42 +0900 Subject: [PATCH 05/16] Add a code to check module_system To prevent decreasing "plugin_session_count", because the context is not created if it is a remote URL. Change-Id: I5a85ee2794bcb3b454ec937859435e62cd12d6ff Signed-off-by: jaekuk, lee --- extensions/renderer/xwalk_extension_renderer_controller.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/renderer/xwalk_extension_renderer_controller.cc b/extensions/renderer/xwalk_extension_renderer_controller.cc index 01c1ece..6c8dd11 100755 --- a/extensions/renderer/xwalk_extension_renderer_controller.cc +++ b/extensions/renderer/xwalk_extension_renderer_controller.cc @@ -91,9 +91,12 @@ void XWalkExtensionRendererController::DidCreateScriptContext( void XWalkExtensionRendererController::WillReleaseScriptContext( v8::Handle context) { v8::Context::Scope contextScope(context); + XWalkModuleSystem* module_system = XWalkModuleSystem::GetModuleSystemFromContext(context); + if (module_system) { + plugin_session_count--; + LOGGER(DEBUG) << "plugin_session_count : " << plugin_session_count; + } XWalkModuleSystem::ResetModuleSystemFromContext(context); - plugin_session_count--; - LOGGER(DEBUG) << "plugin_session_count : " << plugin_session_count; } void XWalkExtensionRendererController::OnReceivedIPCMessage( -- 2.7.4 From ab93561c683c7e1e58ca49d6be8d6640ff3dd58b Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Mon, 6 Feb 2017 13:09:15 +0900 Subject: [PATCH 06/16] Terminate properly when triggering hardware back key event Termination should not be done when there are multiple webviews and hardware back key event is triggered for page navigation. The termination needs to be done only if there is one webview on view stack. This CL adds condition for the checking webview count. PLM: P170125-05834 Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2951 Change-Id: I6d4056c46a0c9999d068d1dd4c14d4f4793457a0 Signed-off-by: Youngsoo Choi --- runtime/browser/web_application.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index ac93129..a99a876 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -931,8 +931,12 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { if(enabled) view->EvalJavascript(kBackKeyEventScript); if (!view->Backward()) { - LOGGER(DEBUG) << "Terminate"; - Terminate(); + if (view_stack_.size() == 1) { + LOGGER(DEBUG) << "Terminate"; + Terminate(); + } else { + RemoveWebViewFromStack(view_stack_.front()); + } } } return; @@ -947,8 +951,12 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { (app_data_->widget_info() != NULL && app_data_->widget_info()->view_modes() == "windowed")) { if (!view->Backward()) { - LOGGER(DEBUG) << "Terminate"; - Terminate(); + if (view_stack_.size() == 1) { + LOGGER(DEBUG) << "Terminate"; + Terminate(); + } else { + RemoveWebViewFromStack(view_stack_.front()); + } } } } else if (enabled && kKeyNameMenu == keyname) { -- 2.7.4 From f2afa7508b8bcbdbf23c0818b0be0c6b4b5ed548 Mon Sep 17 00:00:00 2001 From: Youngcheol Kang Date: Tue, 20 Dec 2016 20:37:38 +0900 Subject: [PATCH 07/16] Fix for handling CSP behavior for backward compatibility with tizen 2.x WRT delivers the CSP elements of config.xml in web application to the webengine through ewk_view_content_security_policy_set API. However, some problem takes place in web application which doesn't set CSP element in config.xml. In order to resolve this compatibility problem, this patch adds the workaround codes for backward compatibility with tizen 2.x by request of webengine. In the webapp of tizen 2.x, this patch allows the all CSP policy by using "allow *;" element. Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2689 Change-Id: Ifba3a8db7fa5a7ab984e9746ba8e3cbb7a901c10 Signed-off-by: Youngcheol Kang --- runtime/browser/web_application.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index a99a876..0bb0383 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -455,7 +455,19 @@ bool WebApplication::Initialize() { security_model_version_ = 2; if (app_data_->csp_info() == NULL || app_data_->csp_info()->security_rules().empty()) { - csp_rule_ = kDefaultCSPRule; + // Add the workaround codes for backward compatibility with tizen 2.x + // by request of webengine. In the webapp of tizen 2.x, this patch allows + // the all CSP policy by using "allow *;" option. + if (app_data_->tizen_application_info() != NULL && + !app_data_->tizen_application_info()->required_version().empty()) { + std::string tizen_version = app_data_->tizen_application_info()->required_version(); + if (tizen_version[0] == '2') + csp_rule_ = "allow *;"; + else + csp_rule_ = kDefaultCSPRule; + } else { + csp_rule_ = kDefaultCSPRule; + } } else { csp_rule_ = app_data_->csp_info()->security_rules(); } -- 2.7.4 From 94c113bad5aa4f2d1886ea9fec5af9f4da642a78 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Fri, 24 Mar 2017 17:00:38 +0900 Subject: [PATCH 08/16] Specifiy that this supports M47 Change-Id: I2317d9f8dff25e1aa557f645c892b85fe261d0f3 Signed-off-by: jaekuk, lee --- packaging/crosswalk-tizen.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/crosswalk-tizen.spec b/packaging/crosswalk-tizen.spec index e908515..3ea5ab2 100755 --- a/packaging/crosswalk-tizen.spec +++ b/packaging/crosswalk-tizen.spec @@ -29,7 +29,7 @@ BuildRequires: pkgconfig(capi-appfw-app-manager) BuildRequires: pkgconfig(capi-appfw-package-manager) BuildRequires: pkgconfig(capi-system-system-settings) BuildRequires: pkgconfig(capi-ui-efl-util) -BuildRequires: pkgconfig(chromium-efl) +BuildRequires: pkgconfig(chromium-efl) < 48.0.0, pkgconfig(chromium-efl) >= 47.0.0 BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(deviced) BuildRequires: pkgconfig(dlog) -- 2.7.4 From 12eb06fa43bc289e46cee0b4f838491d12566ce5 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 11 Apr 2017 17:29:26 +0900 Subject: [PATCH 09/16] Initialized constructor Following members are initialized. => main_loop, session_counter Change-Id: Ibbea601f7dd087eb01a498fca97199c1f253ef4a Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 0bb0383..5cb2b78 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -486,6 +486,14 @@ bool WebApplication::Initialize() { window_->EnableManualRotation(true); #endif // MANUAL_ROTATE_FEATURE_SUPPORT + main_loop.application = NULL; + main_loop.timer = NULL; + session_counter.application = NULL; + session_counter.timer = NULL; + m_tizenCompatibilitySettings.m_major = 0; + m_tizenCompatibilitySettings.m_minor = 0; + m_tizenCompatibilitySettings.m_release = 0; + return true; } -- 2.7.4 From 469daf2203e615c645bbc5b98a5782bdf16f3140 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Wed, 19 Apr 2017 14:03:07 +0900 Subject: [PATCH 10/16] Changed the order of elm_exit() and elm_shutdown() Change-Id: Id8699768ee55faa3da46c677675d5ece135457ba Signed-off-by: jaekuk, lee --- runtime/browser/runtime_process.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/browser/runtime_process.cc b/runtime/browser/runtime_process.cc index a085bbc..5401d10 100755 --- a/runtime/browser/runtime_process.cc +++ b/runtime/browser/runtime_process.cc @@ -139,8 +139,8 @@ int real_main(int argc, char* argv[]) { } LOGGER(DEBUG) << "ewk_shutdown"; ewk_shutdown(); - elm_shutdown(); elm_exit(); + elm_shutdown(); LOGGER(DEBUG) << "EXIT_SUCCESS"; return EXIT_SUCCESS; -- 2.7.4 From a886b3131b3c14c48b9b57274767a1e316bf3766 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Wed, 19 Apr 2017 14:03:07 +0900 Subject: [PATCH 11/16] Changed the order of elm_exit() and elm_shutdown(). Elm API should be used in the following order: 1. elm_init 2. elm_run 3. elm_exit 4. elm_shutdown Change-Id: Id8699768ee55faa3da46c677675d5ece135457ba Signed-off-by: jaekuk, lee --- runtime/browser/runtime_process.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/browser/runtime_process.cc b/runtime/browser/runtime_process.cc index a085bbc..5401d10 100755 --- a/runtime/browser/runtime_process.cc +++ b/runtime/browser/runtime_process.cc @@ -139,8 +139,8 @@ int real_main(int argc, char* argv[]) { } LOGGER(DEBUG) << "ewk_shutdown"; ewk_shutdown(); - elm_shutdown(); elm_exit(); + elm_shutdown(); LOGGER(DEBUG) << "EXIT_SUCCESS"; return EXIT_SUCCESS; -- 2.7.4 From 4336915fb56f6a90adf28e27e6a86bc47c38bf52 Mon Sep 17 00:00:00 2001 From: Youngcheol Kang Date: Wed, 10 May 2017 17:10:21 +0900 Subject: [PATCH 12/16] fixup! Implement Fullscreen API In tizen 2.4 environment, WRT calls the ewk_view_fullscreen_exit() API and exits the event handler when pressing hardware back key if it's fullscreen mode in only "Software key" mode or "windowed" view mode. However above two conditions(software key and windowed view modes) were omitted in tizen 3.0, so the ewk_view_fullscreen_exit() API was always called when pressing hardware back key in fullscreen mode. This CL fixes these problem. Bug: http://suprem.sec.samsung.net/jira/browse/TWF-3201 Change-Id: I4dda2d78be7af8cf75df72875aa2d7e94bbe2da9 Signed-off-by: Youngcheol Kang --- runtime/browser/web_application.cc | 5 +++++ runtime/browser/web_view_impl.cc | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 5cb2b78..240df69 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -978,6 +978,11 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { RemoveWebViewFromStack(view_stack_.front()); } } + + if (app_data_->widget_info()->view_modes() == "fullscreen") { + ewk_view_fullscreen_exit(view->evas_object()); + return; + } } } else if (enabled && kKeyNameMenu == keyname) { view->EvalJavascript(kMenuKeyEventScript); diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc index 162bca9..797f98e 100644 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -980,10 +980,6 @@ void WebViewImpl::OnRotation(int degree) { void WebViewImpl::OnKeyEvent(Eext_Callback_Type key_type) { std::string keyname; if (key_type == EEXT_CALLBACK_BACK) { - if (fullscreen_) { - ewk_view_fullscreen_exit(ewk_view_); - return; - } if (EINA_TRUE == ewk_view_text_selection_clear(ewk_view_)) { return; } -- 2.7.4 From 19e8b8e8c6ab74e4f804e362dbe2477015a5dd2e Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Thu, 15 Jun 2017 15:12:39 +0900 Subject: [PATCH 13/16] Changed a string to a variable "fullscreen" => kViewmodeTypeFullscreen "windowed" => kViewmodeTypeWindowed Change-Id: I354ce4c9fa84745c9c18d208faf570a9b16e970b Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 240df69..191023c 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -143,6 +143,9 @@ const char* kDefaultCSPRule = const char* kResWgtPath = "res/wgt/"; const char* kAppControlMain = "http://tizen.org/appcontrol/operation/main"; +const std::string kViewmodeTypeFullscreen = "fullscreen"; +const std::string kViewmodeTypeWindowed = "windowed"; + // Looking for added privilege by Application developer in config.xml. bool FindPrivilegeFromConfig(common::ApplicationData* app_data, const std::string& privilege) { @@ -445,7 +448,7 @@ bool WebApplication::Initialize() { } if (app_data_->widget_info() != NULL && - app_data_->widget_info()->view_modes() == "fullscreen") { + app_data_->widget_info()->view_modes() == kViewmodeTypeFullscreen) { window_->SetCurrentViewModeFullScreen(true); window_->FullScreen(true); } @@ -969,7 +972,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { if ((app_data_->setting_info() != NULL && app_data_->setting_info()->backbutton_presence()) || (app_data_->widget_info() != NULL && - app_data_->widget_info()->view_modes() == "windowed")) { + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { if (!view->Backward()) { if (view_stack_.size() == 1) { LOGGER(DEBUG) << "Terminate"; @@ -979,7 +982,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { } } - if (app_data_->widget_info()->view_modes() == "fullscreen") { + if (app_data_->widget_info()->view_modes() == kViewmodeTypeFullscreen) { ewk_view_fullscreen_exit(view->evas_object()); return; } -- 2.7.4 From 91759055088368ef3792c32a3a8120189456b2ec Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 20 Jun 2017 09:59:40 +0900 Subject: [PATCH 14/16] Implemented progressbar for web application Change-Id: I59bea64514e4a7adb53736bacb9267690b8a44ab Signed-off-by: jaekuk, lee --- runtime/browser/native_window.cc | 29 +++++++++++++++++++++++++++++ runtime/browser/native_window.h | 8 ++++++++ runtime/browser/web_application.cc | 28 ++++++++++++++++++++++++++++ runtime/browser/web_application.h | 3 +++ 4 files changed, 68 insertions(+) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 9350c66..40162be 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -75,6 +75,10 @@ NativeWindow::NativeWindow() currentViewModeFullScreen_(false), focus_(NULL), content_(NULL), +#ifdef PROFILE_MOBILE + progressbar_(NULL), + top_layout_(NULL), +#endif rotation_(0), handler_id_(0) { } @@ -126,6 +130,9 @@ void NativeWindow::Initialize() { EVAS_SIZE_EXPAND_FILL(top_layout); elm_object_content_set(conformant, top_layout); evas_object_show(top_layout); +#ifdef PROFILE_MOBILE + top_layout_ = top_layout; +#endif // focus Evas_Object* focus = elm_bg_add(top_layout); @@ -139,6 +146,17 @@ void NativeWindow::Initialize() { evas_object_show(focus); focus_ = focus; +#ifdef PROFILE_MOBILE + // progressbar + Evas_Object *progressbar = elm_progressbar_add(top_layout); + EVAS_SIZE_EXPAND_FILL(progressbar); + elm_progressbar_unit_format_set(progressbar, "%1.1f%%"); + elm_progressbar_horizontal_set(progressbar, EINA_TRUE); + elm_object_part_content_set(top_layout, "elm.swallow.progress", progressbar); + evas_object_show(progressbar); + progressbar_ = progressbar; +#endif + // focus callback auto focus_callback = [](void* user_data, Evas_Object*, @@ -306,4 +324,15 @@ void NativeWindow::ManualRotationDone() { } #endif // MANUAL_ROTATE_FEATURE_SUPPORT +#ifdef PROFILE_MOBILE +void NativeWindow::SignalEmit(const char* emission, + const char* source) { + elm_object_signal_emit(top_layout_, emission, source); +} + +void NativeWindow::UpdateProgress(double value) { + elm_progressbar_value_set(progressbar_, ELM_SCALE_SIZE(value)); +} +#endif + } // namespace runtime diff --git a/runtime/browser/native_window.h b/runtime/browser/native_window.h index 7d23aa0..a44acd7 100755 --- a/runtime/browser/native_window.h +++ b/runtime/browser/native_window.h @@ -65,6 +65,10 @@ class NativeWindow { void EnableManualRotation(bool enable); void ManualRotationDone(); #endif // MANUAL_ROTATE_FEATURE_SUPPORT +#ifdef PROFILE_MOBILE + void SignalEmit(const char* emission, const char* source); + void UpdateProgress(double value); +#endif protected: virtual Evas_Object* CreateWindowInternal() = 0; @@ -82,6 +86,10 @@ class NativeWindow { bool currentViewModeFullScreen_; Evas_Object* focus_; Evas_Object* content_; +#ifdef PROFILE_MOBILE + Evas_Object* progressbar_; + Evas_Object* top_layout_; +#endif int rotation_; int handler_id_; ScreenOrientation natural_orientation_; diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 191023c..f70c87a 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -143,6 +143,12 @@ const char* kDefaultCSPRule = const char* kResWgtPath = "res/wgt/"; const char* kAppControlMain = "http://tizen.org/appcontrol/operation/main"; +#ifdef PROFILE_MOBILE +// window signal callback +const char *kEdjeShowProgressSignal = "show,progress,signal"; +const char *kEdjeHideProgressSignal = "hide,progress,signal"; +#endif + const std::string kViewmodeTypeFullscreen = "fullscreen"; const std::string kViewmodeTypeWindowed = "windowed"; @@ -1125,8 +1131,30 @@ void WebApplication::OnLoadStart(WebView* /*view*/) { LOGGER(DEBUG) << "LoadStart"; } +#ifdef PROFILE_MOBILE +void WebApplication::OnLoadProgress(WebView* view, double persent) { + LOGGER(DEBUG) << "LoadProgress, progress ;"<setting_info() != NULL && + app_data_->setting_info()->progressbar_presence()) || + (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { + window_->SignalEmit(kEdjeShowProgressSignal, ""); + window_->UpdateProgress(persent); + } +} +#endif + void WebApplication::OnLoadFinished(WebView* /*view*/) { LOGGER(DEBUG) << "LoadFinished"; +#ifdef PROFILE_MOBILE + if ((app_data_->setting_info() != NULL && + app_data_->setting_info()->progressbar_presence()) || + (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { + window_->SignalEmit(kEdjeHideProgressSignal, ""); + } +#endif splash_screen_->HideSplashScreen(SplashScreen::HideReason::LOADFINISHED); } diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 20d9082..f088e43 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -70,6 +70,9 @@ class WebApplication : public WebView::EventListener { virtual void OnHardwareKey(WebView* view, const std::string& keyname); virtual void OnConsoleMessage(const std::string& msg, int level); virtual void OnLoadStart(WebView* view); +#ifdef PROFILE_MOBILE + virtual void OnLoadProgress(WebView* view, double persent); +#endif virtual void OnLoadFinished(WebView* view); virtual void OnRendered(WebView* view); virtual void OnLanguageChanged(); -- 2.7.4 From 678c0329c984e05b4b6cc9c5534c48eba242ad80 Mon Sep 17 00:00:00 2001 From: jaekuk lee Date: Tue, 20 Jun 2017 04:16:16 +0000 Subject: [PATCH 15/16] Revert "Implemented progressbar for web application" This reverts commit 91759055088368ef3792c32a3a8120189456b2ec. Change-Id: I968d22d6301db756615382f9577d61e8a536691e --- runtime/browser/native_window.cc | 29 ----------------------------- runtime/browser/native_window.h | 8 -------- runtime/browser/web_application.cc | 28 ---------------------------- runtime/browser/web_application.h | 3 --- 4 files changed, 68 deletions(-) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 40162be..9350c66 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -75,10 +75,6 @@ NativeWindow::NativeWindow() currentViewModeFullScreen_(false), focus_(NULL), content_(NULL), -#ifdef PROFILE_MOBILE - progressbar_(NULL), - top_layout_(NULL), -#endif rotation_(0), handler_id_(0) { } @@ -130,9 +126,6 @@ void NativeWindow::Initialize() { EVAS_SIZE_EXPAND_FILL(top_layout); elm_object_content_set(conformant, top_layout); evas_object_show(top_layout); -#ifdef PROFILE_MOBILE - top_layout_ = top_layout; -#endif // focus Evas_Object* focus = elm_bg_add(top_layout); @@ -146,17 +139,6 @@ void NativeWindow::Initialize() { evas_object_show(focus); focus_ = focus; -#ifdef PROFILE_MOBILE - // progressbar - Evas_Object *progressbar = elm_progressbar_add(top_layout); - EVAS_SIZE_EXPAND_FILL(progressbar); - elm_progressbar_unit_format_set(progressbar, "%1.1f%%"); - elm_progressbar_horizontal_set(progressbar, EINA_TRUE); - elm_object_part_content_set(top_layout, "elm.swallow.progress", progressbar); - evas_object_show(progressbar); - progressbar_ = progressbar; -#endif - // focus callback auto focus_callback = [](void* user_data, Evas_Object*, @@ -324,15 +306,4 @@ void NativeWindow::ManualRotationDone() { } #endif // MANUAL_ROTATE_FEATURE_SUPPORT -#ifdef PROFILE_MOBILE -void NativeWindow::SignalEmit(const char* emission, - const char* source) { - elm_object_signal_emit(top_layout_, emission, source); -} - -void NativeWindow::UpdateProgress(double value) { - elm_progressbar_value_set(progressbar_, ELM_SCALE_SIZE(value)); -} -#endif - } // namespace runtime diff --git a/runtime/browser/native_window.h b/runtime/browser/native_window.h index a44acd7..7d23aa0 100755 --- a/runtime/browser/native_window.h +++ b/runtime/browser/native_window.h @@ -65,10 +65,6 @@ class NativeWindow { void EnableManualRotation(bool enable); void ManualRotationDone(); #endif // MANUAL_ROTATE_FEATURE_SUPPORT -#ifdef PROFILE_MOBILE - void SignalEmit(const char* emission, const char* source); - void UpdateProgress(double value); -#endif protected: virtual Evas_Object* CreateWindowInternal() = 0; @@ -86,10 +82,6 @@ class NativeWindow { bool currentViewModeFullScreen_; Evas_Object* focus_; Evas_Object* content_; -#ifdef PROFILE_MOBILE - Evas_Object* progressbar_; - Evas_Object* top_layout_; -#endif int rotation_; int handler_id_; ScreenOrientation natural_orientation_; diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index f70c87a..191023c 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -143,12 +143,6 @@ const char* kDefaultCSPRule = const char* kResWgtPath = "res/wgt/"; const char* kAppControlMain = "http://tizen.org/appcontrol/operation/main"; -#ifdef PROFILE_MOBILE -// window signal callback -const char *kEdjeShowProgressSignal = "show,progress,signal"; -const char *kEdjeHideProgressSignal = "hide,progress,signal"; -#endif - const std::string kViewmodeTypeFullscreen = "fullscreen"; const std::string kViewmodeTypeWindowed = "windowed"; @@ -1131,30 +1125,8 @@ void WebApplication::OnLoadStart(WebView* /*view*/) { LOGGER(DEBUG) << "LoadStart"; } -#ifdef PROFILE_MOBILE -void WebApplication::OnLoadProgress(WebView* view, double persent) { - LOGGER(DEBUG) << "LoadProgress, progress ;"<setting_info() != NULL && - app_data_->setting_info()->progressbar_presence()) || - (app_data_->widget_info() != NULL && - app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { - window_->SignalEmit(kEdjeShowProgressSignal, ""); - window_->UpdateProgress(persent); - } -} -#endif - void WebApplication::OnLoadFinished(WebView* /*view*/) { LOGGER(DEBUG) << "LoadFinished"; -#ifdef PROFILE_MOBILE - if ((app_data_->setting_info() != NULL && - app_data_->setting_info()->progressbar_presence()) || - (app_data_->widget_info() != NULL && - app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { - window_->SignalEmit(kEdjeHideProgressSignal, ""); - } -#endif splash_screen_->HideSplashScreen(SplashScreen::HideReason::LOADFINISHED); } diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index f088e43..20d9082 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -70,9 +70,6 @@ class WebApplication : public WebView::EventListener { virtual void OnHardwareKey(WebView* view, const std::string& keyname); virtual void OnConsoleMessage(const std::string& msg, int level); virtual void OnLoadStart(WebView* view); -#ifdef PROFILE_MOBILE - virtual void OnLoadProgress(WebView* view, double persent); -#endif virtual void OnLoadFinished(WebView* view); virtual void OnRendered(WebView* view); virtual void OnLanguageChanged(); -- 2.7.4 From 75a6c3d208410458eec5b0804f85ff8b0a121dfc Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 20 Jun 2017 13:58:27 +0900 Subject: [PATCH 16/16] Implemented progressbar for web application issue : http://suprem.sec.samsung.net/jira/browse/MPR-1117 Hosted web app such as YouTube displays a white screen until the page finishes loading. Modified WRT to display progressbar until the page finishes loading if progressbar-presence is enabled in config.xml. Change-Id: I877ff1bc6e6c0696512cec10cd8174a27db44af2 Signed-off-by: jaekuk, lee --- runtime/browser/native_window.cc | 29 +++++++++++++++++++++++++++++ runtime/browser/native_window.h | 8 ++++++++ runtime/browser/web_application.cc | 32 ++++++++++++++++++++++++++++++++ runtime/browser/web_application.h | 3 +++ 4 files changed, 72 insertions(+) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 9350c66..40162be 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -75,6 +75,10 @@ NativeWindow::NativeWindow() currentViewModeFullScreen_(false), focus_(NULL), content_(NULL), +#ifdef PROFILE_MOBILE + progressbar_(NULL), + top_layout_(NULL), +#endif rotation_(0), handler_id_(0) { } @@ -126,6 +130,9 @@ void NativeWindow::Initialize() { EVAS_SIZE_EXPAND_FILL(top_layout); elm_object_content_set(conformant, top_layout); evas_object_show(top_layout); +#ifdef PROFILE_MOBILE + top_layout_ = top_layout; +#endif // focus Evas_Object* focus = elm_bg_add(top_layout); @@ -139,6 +146,17 @@ void NativeWindow::Initialize() { evas_object_show(focus); focus_ = focus; +#ifdef PROFILE_MOBILE + // progressbar + Evas_Object *progressbar = elm_progressbar_add(top_layout); + EVAS_SIZE_EXPAND_FILL(progressbar); + elm_progressbar_unit_format_set(progressbar, "%1.1f%%"); + elm_progressbar_horizontal_set(progressbar, EINA_TRUE); + elm_object_part_content_set(top_layout, "elm.swallow.progress", progressbar); + evas_object_show(progressbar); + progressbar_ = progressbar; +#endif + // focus callback auto focus_callback = [](void* user_data, Evas_Object*, @@ -306,4 +324,15 @@ void NativeWindow::ManualRotationDone() { } #endif // MANUAL_ROTATE_FEATURE_SUPPORT +#ifdef PROFILE_MOBILE +void NativeWindow::SignalEmit(const char* emission, + const char* source) { + elm_object_signal_emit(top_layout_, emission, source); +} + +void NativeWindow::UpdateProgress(double value) { + elm_progressbar_value_set(progressbar_, ELM_SCALE_SIZE(value)); +} +#endif + } // namespace runtime diff --git a/runtime/browser/native_window.h b/runtime/browser/native_window.h index 7d23aa0..a44acd7 100755 --- a/runtime/browser/native_window.h +++ b/runtime/browser/native_window.h @@ -65,6 +65,10 @@ class NativeWindow { void EnableManualRotation(bool enable); void ManualRotationDone(); #endif // MANUAL_ROTATE_FEATURE_SUPPORT +#ifdef PROFILE_MOBILE + void SignalEmit(const char* emission, const char* source); + void UpdateProgress(double value); +#endif protected: virtual Evas_Object* CreateWindowInternal() = 0; @@ -82,6 +86,10 @@ class NativeWindow { bool currentViewModeFullScreen_; Evas_Object* focus_; Evas_Object* content_; +#ifdef PROFILE_MOBILE + Evas_Object* progressbar_; + Evas_Object* top_layout_; +#endif int rotation_; int handler_id_; ScreenOrientation natural_orientation_; diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 191023c..09b6ad1 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -143,6 +143,12 @@ const char* kDefaultCSPRule = const char* kResWgtPath = "res/wgt/"; const char* kAppControlMain = "http://tizen.org/appcontrol/operation/main"; +#ifdef PROFILE_MOBILE +// window signal callback +const char *kEdjeShowProgressSignal = "show,progress,signal"; +const char *kEdjeHideProgressSignal = "hide,progress,signal"; +#endif + const std::string kViewmodeTypeFullscreen = "fullscreen"; const std::string kViewmodeTypeWindowed = "windowed"; @@ -1125,8 +1131,34 @@ void WebApplication::OnLoadStart(WebView* /*view*/) { LOGGER(DEBUG) << "LoadStart"; } +#ifdef PROFILE_MOBILE +void WebApplication::OnLoadProgress(WebView* view, double persent) { + LOGGER(DEBUG) << "LoadProgress, progress ;"<setting_info() != NULL && + app_data_->setting_info()->progressbar_presence()) || + (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { + if (persent == 1.0) { + window_->SignalEmit(kEdjeHideProgressSignal, ""); + } else { + window_->SignalEmit(kEdjeShowProgressSignal, ""); + window_->UpdateProgress(persent); + } + } +} +#endif + void WebApplication::OnLoadFinished(WebView* /*view*/) { LOGGER(DEBUG) << "LoadFinished"; +#ifdef PROFILE_MOBILE + if ((app_data_->setting_info() != NULL && + app_data_->setting_info()->progressbar_presence()) || + (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { + window_->SignalEmit(kEdjeHideProgressSignal, ""); + } +#endif splash_screen_->HideSplashScreen(SplashScreen::HideReason::LOADFINISHED); } diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 20d9082..f088e43 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -70,6 +70,9 @@ class WebApplication : public WebView::EventListener { virtual void OnHardwareKey(WebView* view, const std::string& keyname); virtual void OnConsoleMessage(const std::string& msg, int level); virtual void OnLoadStart(WebView* view); +#ifdef PROFILE_MOBILE + virtual void OnLoadProgress(WebView* view, double persent); +#endif virtual void OnLoadFinished(WebView* view); virtual void OnRendered(WebView* view); virtual void OnLanguageChanged(); -- 2.7.4