From be542f8c9e87cc13d60d692024fb7a9b46b11937 Mon Sep 17 00:00:00 2001 From: Yunchan Cho Date: Sat, 9 Mar 2013 11:58:27 +0900 Subject: [PATCH] Set proper title to page on handling tizen scheme [Issue#] DCM-712 [Problem] Application goes to background even though it don't want [Cause] after handling tizen scheme, page's title property has been changed to abnormal value [Solution] If wrt uses title change callback to handle tizen scheme, wrt set page's real title value to 'document.title' property explicitly. Change-Id: I97df4018a754ccfe606274e24a3a5c8a34273fc0 --- src/view/webkit/view_logic.cpp | 16 ++++++++++++++-- src/view/webkit/view_logic.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index e568efc..f97d32a 100755 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -859,7 +859,7 @@ void ViewLogic::loadFinishedCallback( void ViewLogic::titleChangedCallback( void* data, - Evas_Object* /*obj*/, + Evas_Object* obj, void* eventInfo) { LogDebug("titleChangedCallback called"); @@ -870,12 +870,24 @@ void ViewLogic::titleChangedCallback( if (0 == strlen(title)) { LogDebug("title data is empty"); + This->m_currentTitle = std::string(); return; } LogDebug("Title = [" << title << "]"); - This->m_schemeSupport->HandleTizenScheme(title, + bool ret = This->m_schemeSupport->HandleTizenScheme( + title, This->m_window, This->m_currentEwkView); + // if result is true, this is tizen scheme + // and then, title is reset to page's real title + if (ret) { + std::string script = "document.title = \""; + script += This->m_currentTitle; + script +="\";"; + ewk_view_script_execute(obj, script.c_str(), didRunJavaScriptCallback, This); + } else { + This->m_currentTitle = std::string(title); + } } void ViewLogic::loadProgressCallback( diff --git a/src/view/webkit/view_logic.h b/src/view/webkit/view_logic.h index 3a2c289..6fb03ac 100755 --- a/src/view/webkit/view_logic.h +++ b/src/view/webkit/view_logic.h @@ -267,6 +267,7 @@ class ViewLogic : public ViewModule::IViewModule WidgetModel* m_model; std::string m_currentUri; std::string m_blockedUri; + std::string m_currentTitle; std::string m_theme; std::string m_startUrl; WRT::UserDelegatesPtr m_cbs; -- 2.7.4