From 24e21da0fa1b1db2c2bb0d0996c2fb6d2d7c163c Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Wed, 23 Nov 2016 20:09:37 +0900 Subject: [PATCH 01/16] Apply renaming of SplashScreenHandler Author: JongHeonChoi https://github.com/crosswalk-project/crosswalk-tizen/pull/138 Change-Id: Ie8dbcf0bdbdfd430deacdc7b94cfa7abfce443d7 Signed-off-by: jaekuk, lee --- common/application_data.cc | 6 +++--- common/application_data.h | 6 +++--- runtime/browser/splash_screen.cc | 12 ++++++------ runtime/browser/splash_screen.h | 10 +++++----- runtime/browser/web_application.h | 1 - 5 files changed, 17 insertions(+), 18 deletions(-) mode change 100644 => 100755 common/application_data.cc mode change 100644 => 100755 common/application_data.h mode change 100644 => 100755 runtime/browser/splash_screen.cc mode change 100644 => 100755 runtime/browser/splash_screen.h diff --git a/common/application_data.cc b/common/application_data.cc old mode 100644 new mode 100755 index 091b7e5..0559c10 --- a/common/application_data.cc +++ b/common/application_data.cc @@ -89,7 +89,7 @@ std::shared_ptr return setting_info_; } -std::shared_ptr +std::shared_ptr ApplicationData::splash_screen_info() const { return splash_screen_info_; } @@ -215,9 +215,9 @@ bool ApplicationData::LoadManifestData() { wgt::parse::SettingInfo::Key())); splash_screen_info_ = - std::static_pointer_cast( + std::static_pointer_cast( widget_config_parser->GetManifestData( - wgt::parse::SplashScreenInfo::Key())); + wgt::parse::LaunchScreenInfo::Key())); tizen_application_info_ = std::static_pointer_cast( diff --git a/common/application_data.h b/common/application_data.h old mode 100644 new mode 100755 index 43d9c59..1a58ca9 --- a/common/application_data.h +++ b/common/application_data.h @@ -24,12 +24,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -68,7 +68,7 @@ class ApplicationData { permissions_info() const; std::shared_ptr setting_info() const; - std::shared_ptr + std::shared_ptr splash_screen_info() const; std::shared_ptr tizen_application_info() const; @@ -101,7 +101,7 @@ class ApplicationData { permissions_info_; std::shared_ptr setting_info_; - std::shared_ptr + std::shared_ptr splash_screen_info_; std::shared_ptr tizen_application_info_; diff --git a/runtime/browser/splash_screen.cc b/runtime/browser/splash_screen.cc old mode 100644 new mode 100755 index 9a4cd4f..89649c6 --- a/runtime/browser/splash_screen.cc +++ b/runtime/browser/splash_screen.cc @@ -25,7 +25,7 @@ #include "common/logger.h" #include "runtime/browser/native_window.h" -#include "wgt_manifest_handlers/splash_screen_handler.h" +#include "wgt_manifest_handlers/launch_screen_handler.h" using ScreenOrientation = runtime::NativeWindow::ScreenOrientation; @@ -35,7 +35,7 @@ enum class BorderOption { REPEAT = 1, STRETCH, ROUND }; wgt::parse::ScreenOrientation ChooseOrientation( const std::map& splash_map, + wgt::parse::LaunchScreenData>& splash_map, ScreenOrientation screen_orientation) { auto orientation_pair = splash_map.end(); @@ -96,7 +96,7 @@ namespace runtime { SplashScreen::SplashScreen( runtime::NativeWindow* window, - std::shared_ptr ss_info, + std::shared_ptr ss_info, const std::string& app_path) : ss_info_(ss_info), window_(window), @@ -106,7 +106,7 @@ SplashScreen::SplashScreen( is_active_(false) { LOGGER(DEBUG) << "start of create splash screen"; if (ss_info == nullptr) return; - auto splash_map = ss_info->splash_screen_data(); + auto splash_map = ss_info->launch_screen_data(); auto used_orientation = ChooseOrientation(splash_map, window->orientation()); if (used_orientation == wgt::parse::ScreenOrientation::NONE) return; @@ -153,7 +153,7 @@ std::pair SplashScreen::GetDimensions() { } void SplashScreen::SetBackground( - const wgt::parse::SplashScreenData& splash_data, Evas_Object* parent, + const wgt::parse::LaunchScreenData& splash_data, Evas_Object* parent, const SplashScreenBound& bound, const std::string& app_path) { background_ = elm_bg_add(parent); if (!background_) return; @@ -216,7 +216,7 @@ void SplashScreen::SetBackground( } void SplashScreen::SetImage( - const wgt::parse::SplashScreenData& splash_data, Evas_Object* parent, + const wgt::parse::LaunchScreenData& splash_data, Evas_Object* parent, const SplashScreenBound& bound, const std::string& app_path) { if (!background_) return; image_ = elm_image_add(background_); diff --git a/runtime/browser/splash_screen.h b/runtime/browser/splash_screen.h old mode 100644 new mode 100755 index 90fc979..11d49cd --- a/runtime/browser/splash_screen.h +++ b/runtime/browser/splash_screen.h @@ -26,7 +26,7 @@ #include #include "runtime/browser/native_window.h" -#include "wgt_manifest_handlers/splash_screen_handler.h" +#include "wgt_manifest_handlers/launch_screen_handler.h" namespace runtime { @@ -36,21 +36,21 @@ class SplashScreen { enum class HideReason { RENDERED, LOADFINISHED, CUSTOM }; SplashScreen(NativeWindow* window, - std::shared_ptr ss_info, + std::shared_ptr ss_info, const std::string& app_path); void HideSplashScreen(HideReason reason); private: std::pair GetDimensions(); - void SetBackground(const wgt::parse::SplashScreenData& splash_data, + void SetBackground(const wgt::parse::LaunchScreenData& splash_data, Evas_Object* parent, const SplashScreenBound& bound, const std::string& app_path); - void SetImage(const wgt::parse::SplashScreenData& splash_data, + void SetImage(const wgt::parse::LaunchScreenData& splash_data, Evas_Object* parent, const SplashScreenBound& bound, const std::string& app_path); - std::shared_ptr ss_info_; + std::shared_ptr ss_info_; NativeWindow* window_; Evas_Object* image_; Evas_Object* background_; diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 9dcaa08..8e72b25 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -132,7 +132,6 @@ class WebApplication : public WebView::EventListener { std::string csp_rule_; std::string csp_report_rule_; bool lang_changed_mode_; - }; } // namespace runtime -- 2.7.4 From 09201986924c57607bf464c2b5bc540db5e87d8e Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 29 Nov 2016 14:25:13 +0900 Subject: [PATCH 02/16] modify to send the key to web app Change-Id: Ie570309671cc31036fb3ad2aa1065e6079850c4c 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 b496d53..e3b33b4 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -684,19 +684,22 @@ void WebApplication::OnOrientationLock( void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { // NOTE: This code is added to enable back-key on remote URL + bool enabled = app_data_->setting_info() != NULL + ? app_data_->setting_info()->hwkey_enabled() + : true; + if (!common::utils::StartsWith(view->GetUrl(), kFileScheme)) { if (kKeyNameBack == keyname) { LOGGER(DEBUG) << "Back to previous page for remote URL"; if (!view->Backward()) { + if(enabled) + view->EvalJavascript(kBackKeyEventScript); RemoveWebViewFromStack(view_stack_.front()); } } return; } - bool enabled = app_data_->setting_info() != NULL - ? app_data_->setting_info()->hwkey_enabled() - : true; if (enabled && kKeyNameBack == keyname) { view->EvalJavascript(kBackKeyEventScript); // NOTE: This code is added for backward compatibility. -- 2.7.4 From ce8f967c88b45b7e21664c6e06164be73b4f8364 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 29 Nov 2016 14:25:13 +0900 Subject: [PATCH 03/16] modify to send backkey to web app on remote url. Change-Id: Ie570309671cc31036fb3ad2aa1065e6079850c4c 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 b496d53..e3b33b4 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -684,19 +684,22 @@ void WebApplication::OnOrientationLock( void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { // NOTE: This code is added to enable back-key on remote URL + bool enabled = app_data_->setting_info() != NULL + ? app_data_->setting_info()->hwkey_enabled() + : true; + if (!common::utils::StartsWith(view->GetUrl(), kFileScheme)) { if (kKeyNameBack == keyname) { LOGGER(DEBUG) << "Back to previous page for remote URL"; if (!view->Backward()) { + if(enabled) + view->EvalJavascript(kBackKeyEventScript); RemoveWebViewFromStack(view_stack_.front()); } } return; } - bool enabled = app_data_->setting_info() != NULL - ? app_data_->setting_info()->hwkey_enabled() - : true; if (enabled && kKeyNameBack == keyname) { view->EvalJavascript(kBackKeyEventScript); // NOTE: This code is added for backward compatibility. -- 2.7.4 From ab32f24359aa9a52874231cf78c868793fff7c63 Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Wed, 7 Dec 2016 16:06:37 +0900 Subject: [PATCH 04/16] Fix screen_orientation issue in wearable profile Change-Id: I5459be72dc0984114f4b6dd2a3f56baae90063bf Signed-off-by: min7.choi --- runtime/browser/native_window.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 5712dff..3dbff5e 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -174,11 +174,19 @@ void NativeWindow::Initialize() { rotation_callback, this); +#ifdef PROFILE_WEARABLE + if (w >= h) { + natural_orientation_ = ScreenOrientation::LANDSCAPE_PRIMARY; + } else { + natural_orientation_ = ScreenOrientation::PORTRAIT_PRIMARY; + } +#else if (w > h) { natural_orientation_ = ScreenOrientation::LANDSCAPE_PRIMARY; } else { natural_orientation_ = ScreenOrientation::PORTRAIT_PRIMARY; } +#endif elm_win_indicator_mode_set(window_, ELM_WIN_INDICATOR_SHOW); -- 2.7.4 From fb53f8b871b2e88caebb4fb948aa83b8c22fcd68 Mon Sep 17 00:00:00 2001 From: jaekuk lee Date: Wed, 7 Dec 2016 22:58:47 -0800 Subject: [PATCH 05/16] Revert "Fix screen_orientation issue in wearable profile" This reverts commit ab32f24359aa9a52874231cf78c868793fff7c63. Change-Id: I593553065734a91616d4544270eb8caef3095fae --- runtime/browser/native_window.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 3dbff5e..5712dff 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -174,19 +174,11 @@ void NativeWindow::Initialize() { rotation_callback, this); -#ifdef PROFILE_WEARABLE - if (w >= h) { - natural_orientation_ = ScreenOrientation::LANDSCAPE_PRIMARY; - } else { - natural_orientation_ = ScreenOrientation::PORTRAIT_PRIMARY; - } -#else if (w > h) { natural_orientation_ = ScreenOrientation::LANDSCAPE_PRIMARY; } else { natural_orientation_ = ScreenOrientation::PORTRAIT_PRIMARY; } -#endif elm_win_indicator_mode_set(window_, ELM_WIN_INDICATOR_SHOW); -- 2.7.4 From 6f50045775243e4564a535bed2e6e0c3ccc4ebd7 Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Fri, 9 Dec 2016 11:14:36 +0900 Subject: [PATCH 06/16] Modify using a fullscreen in config.xml(viewmodes), indicator was not seen Change-Id: I44cb9df7d4831501820edd0afd1985754d8c7b1e Signed-off-by: min7.choi --- runtime/browser/web_application.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index e3b33b4..6a58733 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -364,6 +364,11 @@ bool WebApplication::Initialize() { app_data_->widget_info()->default_locale()); } + if (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == "fullscreen") { + window_->FullScreen(true); + } + if (app_data_->csp_info() != NULL || app_data_->csp_report_info() != NULL || app_data_->allowed_navigation_info() != NULL) { security_model_version_ = 2; -- 2.7.4 From 48e7dbd1d24d577257e7de7332ed1c46a824a9c0 Mon Sep 17 00:00:00 2001 From: Youngcheol Kang Date: Tue, 13 Dec 2016 14:54:50 +0900 Subject: [PATCH 07/16] Fixed the crash when the app is terminated through h/w back-key The crash happens due to the callback which occur after destroying WebApplication class. this patch adds the codes to prevent this crash issue by checking the EventListener of WebView class. Bug: http://suprem.sec.samsung.net/jira/browse/TSAM-11504 Change-Id: Ie27666ee604bf375bfc34a43e5e8f24eda758a22 Signed-off-by: Youngcheol Kang --- runtime/browser/web_application.cc | 8 ++++++++ runtime/browser/web_view_impl.cc | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 6a58733..59b8611 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -567,10 +567,18 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) { WebView* current = view_stack_.front(); if (current == view) { + // In order to prevent the crash issue due to the callback + // which occur after destroying WebApplication class, + // we have to set the 'SetEventListener' to NULL. + view->SetEventListener(NULL); view_stack_.pop_front(); } else { auto found = std::find(view_stack_.begin(), view_stack_.end(), view); if (found != view_stack_.end()) { + // In order to prevent the crash issue due to the callback + // which occur after destroying WebApplication class, + // we have to set the 'SetEventListener' to NULL. + view->SetEventListener(NULL); view_stack_.erase(found); } } diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc index e1fdc30..7bab294 100644 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -890,7 +890,8 @@ void WebViewImpl::InitEditorClientImeCallback() { softkeyboard_value.width = self->ime_width_; softkeyboard_value.height = self->ime_height_; - self->listener_->OnSoftKeyboardChangeEvent(self->view_, softkeyboard_value); + if (self->listener_) + self->listener_->OnSoftKeyboardChangeEvent(self->view_, softkeyboard_value); }; auto ime_closed_callback = [](void* user_data, @@ -901,7 +902,8 @@ void WebViewImpl::InitEditorClientImeCallback() { SoftKeyboardChangeEventValue softkeyboard_value; softkeyboard_value.state = "off"; - self->listener_->OnSoftKeyboardChangeEvent(self->view_, softkeyboard_value); + if (self->listener_) + self->listener_->OnSoftKeyboardChangeEvent(self->view_, softkeyboard_value); }; evas_object_smart_callback_add(ewk_view_, "inputmethod,changed", -- 2.7.4 From 428cbd5557186fab1a10097335fba764fa310417 Mon Sep 17 00:00:00 2001 From: "ws29.jung" Date: Tue, 13 Dec 2016 15:54:08 +0900 Subject: [PATCH 08/16] Remove option 'open link in current tab' on WebApp 'open link in current tab' is only for browser app Change-Id: Id8fcc4c6c6f5d894a3501c175f1d7c26249b96d1 Signed-off-by: ws29.jung --- runtime/browser/web_view_impl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc index e1fdc30..c6e3d4f 100644 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -574,6 +574,7 @@ void WebViewImpl::InitCustomContextMenuCallback() { Ewk_Context_Menu_Item_Tag tag = ewk_context_menu_item_tag_get(item); switch (tag) { case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_CURRENT_WINDOW: + case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK: case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW: case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW: case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW: -- 2.7.4 From d88b536ed86a1890a669f9616b4d0427a52caf32 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Wed, 14 Dec 2016 16:04:05 +0900 Subject: [PATCH 09/16] upgrade script numbering Change-Id: I97109343caffcd74b93ebc0430278cbf50d7b2d6 Signed-off-by: jaekuk, lee --- packaging/crosswalk-tizen.spec | 4 ++-- wrt-upgrade/{310.wrt.upgrade.sh => 720.wrt.upgrade.sh} | 0 wrt-upgrade/wrt-upgrade.gyp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename wrt-upgrade/{310.wrt.upgrade.sh => 720.wrt.upgrade.sh} (100%) mode change 100644 => 100755 wrt-upgrade/wrt-upgrade.gyp diff --git a/packaging/crosswalk-tizen.spec b/packaging/crosswalk-tizen.spec index 1b29b72..51e0d20 100755 --- a/packaging/crosswalk-tizen.spec +++ b/packaging/crosswalk-tizen.spec @@ -173,7 +173,7 @@ install -p -m 755 out/Default/wrt-loader %{buildroot}%{_bindir} # wrt-upgrade install -p -m 755 out/Default/wrt-upgrade %{buildroot}%{_bindir} -install -p -m 644 out/Default/gen/310.wrt.upgrade.sh %{buildroot}%{_datadir}/upgrade/scripts/310.wrt.upgrade.sh +install -p -m 644 out/Default/gen/720.wrt.upgrade.sh %{buildroot}%{_datadir}/upgrade/scripts/720.wrt.upgrade.sh %clean rm -fr %{buildroot} @@ -196,5 +196,5 @@ rm -fr %{buildroot} %attr(755,root,root) %{_bindir}/wrt-loader %attr(644,root,root) %{_datadir}/aul/wrt.loader %attr(755,root,root) %{_bindir}/wrt-upgrade -%attr(755,root,root) %{_datadir}/upgrade/scripts/310.wrt.upgrade.sh +%attr(755,root,root) %{_datadir}/upgrade/scripts/720.wrt.upgrade.sh %caps(cap_sys_admin,cap_setgid=ei) %{_bindir}/wrt-loader diff --git a/wrt-upgrade/310.wrt.upgrade.sh b/wrt-upgrade/720.wrt.upgrade.sh similarity index 100% rename from wrt-upgrade/310.wrt.upgrade.sh rename to wrt-upgrade/720.wrt.upgrade.sh diff --git a/wrt-upgrade/wrt-upgrade.gyp b/wrt-upgrade/wrt-upgrade.gyp old mode 100644 new mode 100755 index 9e90439..cc8a116 --- a/wrt-upgrade/wrt-upgrade.gyp +++ b/wrt-upgrade/wrt-upgrade.gyp @@ -26,7 +26,7 @@ { 'destination': '<(SHARED_INTERMEDIATE_DIR)', 'files': [ - '310.wrt.upgrade.sh' + '720.wrt.upgrade.sh' ], }, ], -- 2.7.4 From 31dc726d6753f186c4e815335e8d08edd1f901b7 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Thu, 15 Dec 2016 17:25:39 +0900 Subject: [PATCH 10/16] Show window after launch for remote URL Change-Id: I05af606e60fdafc3f109da953e266301c61cb5ad 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 59b8611..fbf2817 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -444,6 +444,14 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { } launched_ = true; + +#ifdef PROFILE_MOBILE + if (!common::utils::StartsWith(view->GetUrl(), kFileScheme)) { + LOGGER(DEBUG) << "Show window after launch for remote URL"; + window_->Show(); + window_->Active(); + } +#endif // PROFILE_MOBILE } void WebApplication::AppControl( -- 2.7.4 From ce8504d710af908da31c4a4c1b53ff7eceb6a215 Mon Sep 17 00:00:00 2001 From: jaekuk lee Date: Thu, 15 Dec 2016 01:46:59 -0800 Subject: [PATCH 11/16] Revert "Show window after launch for remote URL" This reverts commit 31dc726d6753f186c4e815335e8d08edd1f901b7. Change-Id: Icb8cd8b26c44ae53403ae2ad894eea90ead7851c --- runtime/browser/web_application.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index fbf2817..59b8611 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -444,14 +444,6 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { } launched_ = true; - -#ifdef PROFILE_MOBILE - if (!common::utils::StartsWith(view->GetUrl(), kFileScheme)) { - LOGGER(DEBUG) << "Show window after launch for remote URL"; - window_->Show(); - window_->Active(); - } -#endif // PROFILE_MOBILE } void WebApplication::AppControl( -- 2.7.4 From fb8a39d98f5cf1e3d7f4e9fdbaa4197b90e20dca Mon Sep 17 00:00:00 2001 From: "ws29.jung" Date: Thu, 15 Dec 2016 14:20:22 +0900 Subject: [PATCH 12/16] [HOTFIX] Delay main_loop shutdown to avoid deadlock When keyboard switches from Tizen Keyboard to WebApp Keyboard, keyboard select button enables before WebApp keyboard is completely loaded. In that time if keyboard switches back to Tizen Keyboard, deadlock occurs between main_loop and Webview. To avoid this deadlock, delay main_loop until webview load is finished BUG: http://suprem.sec.samsung.net/jira/browse/TSAM-11361 Change-Id: I469bea8ff1b3dc3bbb69a37f0fe6114f30b8d855 Signed-off-by: ws29.jung --- runtime/browser/runtime_process.cc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/runtime/browser/runtime_process.cc b/runtime/browser/runtime_process.cc index 4d5cb50..b115546 100755 --- a/runtime/browser/runtime_process.cc +++ b/runtime/browser/runtime_process.cc @@ -35,6 +35,15 @@ bool g_prelaunch = false; +#ifdef IME_FEATURE_SUPPORT +static Ecore_Timer* timeout = NULL; + +static Eina_Bool terminateDelayCallback(void* data) { + timeout = NULL; + ecore_main_loop_quit(); + return ECORE_CALLBACK_CANCEL; +} +#endif #ifdef WATCH_FACE_FEATURE_SUPPORT static int setWatchEnv(int argc, char **argv) { bundle *kb = NULL; @@ -132,8 +141,20 @@ int real_main(int argc, char* argv[]) { ret = runtime->Exec(argc, argv); runtime.reset(); } +#ifdef IME_FEATURE_SUPPORT + if (appdata->app_type() == common::ApplicationData::IME) { + timeout = ecore_timer_add(0.5, terminateDelayCallback, NULL); + // This timer is added because of deadlock issue. + // If default keyboard is switched from webapp keyboard to tizen keyboard + // before webapp keyboard is completely loaded, main loop waits + // until webview is closed where webview is waiting to finish load. + // This timer delays main loop shutdown until webview load is finished. + // FIXME: http://suprem.sec.samsung.net/jira/browse/TSAM-11361 + ecore_main_loop_begin(); + } +#endif ewk_shutdown(); - exit(ret); + elm_exit(); return EXIT_SUCCESS; } -- 2.7.4 From 2dad472fad99ddd4d2ce9e38467cc98180301c3a Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Thu, 15 Dec 2016 21:03:48 +0900 Subject: [PATCH 13/16] Show window after launch for remote URL Change-Id: I7ab95b4f88c63c9dc1d1becfa9d07971a2b229c8 Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 59b8611..eb72425 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -444,6 +444,14 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { } launched_ = true; + +#ifdef PROFILE_MOBILE + if (!common::utils::StartsWith(view->GetUrl(), kFileScheme)) { + LOGGER(DEBUG) << "Show window after launch for remote URL"; + window_->Show(); + window_->Active(); + } +#endif // PROFILE_MOBILE } void WebApplication::AppControl( @@ -866,7 +874,7 @@ void WebApplication::OnLoadFinished(WebView* /*view*/) { splash_screen_->HideSplashScreen(SplashScreen::HideReason::LOADFINISHED); } -void WebApplication::OnRendered(WebView* /*view*/) { +void WebApplication::OnRendered(WebView* view) { STEP_PROFILE_END("URL Set -> Rendered"); STEP_PROFILE_END("Start -> Launch Completed"); LOGGER(DEBUG) << "Rendered"; @@ -875,8 +883,15 @@ void WebApplication::OnRendered(WebView* /*view*/) { // Do not show(), active() for language change if(lang_changed_mode_ == false){ // Show window after frame rendered. +#ifdef PROFILE_MOBILE + if (common::utils::StartsWith(view->GetUrl(), kFileScheme)) { + window_->Show(); + window_->Active(); + } +#else // PROFILE_MOBILE window_->Show(); window_->Active(); +#endif } else{ lang_changed_mode_ = false; -- 2.7.4 From b9ccdf51c14fae0176016b40bbe4dcfa73b9ccc5 Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Thu, 15 Dec 2016 21:28:06 +0900 Subject: [PATCH 14/16] Setting custom timeout HTTP (Long polling) Change-Id: I37282aa22b62a1f83cbcf19bfd1bad46255ea2ca Signed-off-by: min7.choi --- runtime/browser/web_application.cc | 8 ++++++++ runtime/browser/web_application.h | 2 +- runtime/browser/web_view.cc | 4 ++++ runtime/browser/web_view.h | 1 + runtime/browser/web_view_impl.cc | 4 ++++ runtime/browser/web_view_impl.h | 1 + 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index eb72425..47da126 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -923,6 +923,14 @@ void WebApplication::SetupWebView(WebView* view) { view->SetCSPRule(csp_report_rule_, true); } } + +// Setup longpolling value + if (app_data_->setting_info() != NULL && + app_data_->setting_info()->long_polling()) { + boost::optional polling_val(app_data_->setting_info()->long_polling()); + unsigned long *ptr = reinterpret_cast (&polling_val.get()); + view->SetLongPolling(*ptr); + } } bool WebApplication::OnDidNavigation(WebView* /*view*/, diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 8e72b25..75b934e 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -117,6 +117,7 @@ class WebApplication : public WebView::EventListener { bool launched_; bool debug_mode_; bool verbose_mode_; + bool lang_changed_mode_; Ewk_Context* ewk_context_; bool has_ownership_of_ewk_context_; NativeWindow* window_; @@ -131,7 +132,6 @@ class WebApplication : public WebView::EventListener { int security_model_version_; std::string csp_rule_; std::string csp_report_rule_; - bool lang_changed_mode_; }; } // namespace runtime diff --git a/runtime/browser/web_view.cc b/runtime/browser/web_view.cc index 1d898a1..c96a28f 100644 --- a/runtime/browser/web_view.cc +++ b/runtime/browser/web_view.cc @@ -89,6 +89,10 @@ void WebView::SetDefaultEncoding(const std::string& encoding) { impl_->SetDefaultEncoding(encoding); } +void WebView::SetLongPolling(unsigned long longpolling) { + impl_->SetLongPolling(longpolling); +} + #ifdef PROFILE_WEARABLE void WebView::SetBGColor(int r, int g, int b, int a) { impl_->SetBGColor(r, g, b, a); diff --git a/runtime/browser/web_view.h b/runtime/browser/web_view.h index be1bcc6..29a6fad 100644 --- a/runtime/browser/web_view.h +++ b/runtime/browser/web_view.h @@ -129,6 +129,7 @@ class WebView { bool SetUserAgent(const std::string& user_agent); void SetCSPRule(const std::string& rule, bool report_only); void SetDefaultEncoding(const std::string& encoding); + void SetLongPolling(unsigned long longpolling); #ifdef PROFILE_WEARABLE void SetBGColor(int r, int g, int b, int a); #endif diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc index 6ad4c2a..9a4e38f 100644 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -1008,6 +1008,10 @@ void WebViewImpl::SetDefaultEncoding(const std::string& encoding) { } } +void WebViewImpl::SetLongPolling(unsigned long longpolling) { + ewk_view_session_timeout_set(ewk_view_, longpolling); +} + #ifdef PROFILE_WEARABLE void WebViewImpl::SetBGColor(int r, int g, int b, int a) { ewk_view_bg_color_set(ewk_view_, r, g, b, a); diff --git a/runtime/browser/web_view_impl.h b/runtime/browser/web_view_impl.h index 73c70c1..eba7748 100644 --- a/runtime/browser/web_view_impl.h +++ b/runtime/browser/web_view_impl.h @@ -49,6 +49,7 @@ class WebViewImpl { bool SetUserAgent(const std::string& user_agent); void SetCSPRule(const std::string& rule, bool report_only); void SetDefaultEncoding(const std::string& encoding); + void SetLongPolling(unsigned long longpolling); #ifdef PROFILE_WEARABLE void SetBGColor(int r, int g, int b, int a); #endif -- 2.7.4 From acbd308b2b8a199b98a9da4d6e0cda2bf7f6d6ae Mon Sep 17 00:00:00 2001 From: Youngcheol Kang Date: Mon, 19 Dec 2016 18:46:49 +0900 Subject: [PATCH 15/16] Handle back-key behavior when viewmode is 'windowed' The Webview should be navigated back in history if the viewmode is 'windowed' in config.xml. This patch adds the codes for handling the back-key behavior when viewmode is 'windowed' for backward compatibility with Tizen 2.x. Bug: P161214-06597 Change-Id: I83dff6c297cbc2baa82fdd19a49b1f89a433710e Signed-off-by: Youngcheol Kang --- runtime/browser/web_application.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 47da126..91614ee 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -725,8 +725,10 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { view->EvalJavascript(kBackKeyEventScript); // NOTE: This code is added for backward compatibility. // If the 'backbutton_presence' is true, WebView should be navigated back. - if (app_data_->setting_info() && - app_data_->setting_info()->backbutton_presence()) { + if ((app_data_->setting_info() != NULL && + app_data_->setting_info()->backbutton_presence()) || + (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == "windowed")) { if (!view->Backward()) { RemoveWebViewFromStack(view_stack_.front()); } -- 2.7.4 From 7b666c7222ef32130f1a887092bbaafc8628663b Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 20 Dec 2016 11:05:33 +0900 Subject: [PATCH 16/16] Add ewk_settings_tizen_compatibility_mode_set API Change-Id: I23b837c6ecb49c5033e8945f8d92991a37b7eaf0 Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 25 +++++++++++++++++++++++++ runtime/browser/web_application.h | 1 + 2 files changed, 26 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 91614ee..50526f4 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -214,6 +214,20 @@ static bool ProcessWellKnownScheme(const std::string& url) { } // namespace +std::vector ParseTizenVersion(const std::string& tizen_string) { + std::vector version(3, 0); + for (unsigned i = 0, index = 0; i < tizen_string.size(); i++) { + if ((i % 2) == 0) { + if (isdigit(tizen_string[i]) && index < version.size()) + version[index++] = atoi(&tizen_string[i]); + else + return std::vector(3, 0); + } else if (tizen_string[i] != '.') + return std::vector(3, 0); + } + return version; +} + WebApplication::WebApplication( NativeWindow* window, common::ApplicationData* app_data) @@ -403,6 +417,7 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { // Setup View WebView* view = new WebView(window_, ewk_context_); SetupWebView(view); + SetupWebViewTizenApplicationInfo(view); std::unique_ptr res = resource_manager_->GetStartResource(appcontrol.get()); @@ -935,6 +950,16 @@ void WebApplication::SetupWebView(WebView* view) { } } +void WebApplication::SetupWebViewTizenApplicationInfo(WebView* view) { + if (app_data_->tizen_application_info() != NULL && + !app_data_->tizen_application_info()->required_version().empty()) { + Ewk_Settings* settings = ewk_view_settings_get(view->evas_object()); + std::string tizen_version = app_data_->tizen_application_info()->required_version(); + std::vector parsed_tizen_version = ParseTizenVersion(tizen_version); + ewk_settings_tizen_compatibility_mode_set(settings, parsed_tizen_version[0], parsed_tizen_version[1], parsed_tizen_version[2]); + } +} + bool WebApplication::OnDidNavigation(WebView* /*view*/, const std::string& url) { // scheme handling diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 75b934e..915287d 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -112,6 +112,7 @@ class WebApplication : public WebView::EventListener { void SendAppControlEvent(); void LaunchInspector(common::AppControl* appcontrol); void SetupWebView(WebView* view); + void SetupWebViewTizenApplicationInfo(WebView* view); void RemoveWebViewFromStack(WebView* view); bool launched_; -- 2.7.4