From c31d466fa9c52a86d37c3c9c398fe9f40a9ccf54 Mon Sep 17 00:00:00 2001 From: Yunchan Cho Date: Tue, 20 Nov 2012 18:27:58 +0900 Subject: [PATCH] Change action of appservice in case that serviced page is same to current page of webapp [Issue#] appservice handling is wrong. [Bug] N/A [Cause] N/A [Solution] when appservice is requested and webapp for the appservice already has its service page as top level page, wrt has to raise and activate window, and then fire custom event for appservice. Change-Id: Ia7623cf42320db14885b1ed00342225bff497910 --- src/view/webkit/view_logic.cpp | 25 +++++++++++++++++++++---- src/wrt-client/wrt-client.cpp | 4 ---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index e58cc91..2055dc5 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -241,6 +241,8 @@ void ViewLogic::suspendWidget() suspendWebkit(m_currentEwkView); } + evas_object_focus_set(m_currentEwkView, EINA_FALSE); + // call user callback if (!m_cbs->suspend.empty()) { m_cbs->suspend(true); @@ -260,7 +262,7 @@ void ViewLogic::resumeWidget() } if (m_window) { - elm_win_activate(m_window); + elm_win_raise(m_window); } evas_object_focus_set(m_currentEwkView, EINA_TRUE); @@ -294,14 +296,29 @@ void ViewLogic::resetWidget() LogError("Fail to get uri from ewk_view_uri_get"); return; } + + // webview activated + PluginModuleSupport::resume(m_ewkContext); + resumeWebkit(m_currentEwkView); if (DPL::ToUTF8String(*servicedUri) == currentUri) { - LogInfo("current page is reloaded"); - ewk_view_reload(m_currentEwkView); + LogInfo("current page is raised"); + // set only encoded bundle + double scale = elm_config_scale_get(); + PluginModuleSupport::setCustomProperties( + m_ewkContext, + &scale, + ApplicationDataSingleton::Instance().getEncodedBundle()); + PluginModuleSupport::dispatchJavaScriptEvent( + m_ewkContext, + WrtPlugins::W3C::ServiceCustomEvent, + NULL); } else { LogInfo("service page is loaded"); m_currentUri = DPL::ToUTF8String(*servicedUri); - ewk_view_uri_set(m_currentEwkView, m_currentUri.c_str()); + ewk_view_url_set(m_currentEwkView, m_currentUri.c_str()); } + elm_win_raise(m_window); + evas_object_focus_set(m_currentEwkView, EINA_TRUE); } // call user callback diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index df4a3bd..c314618 100755 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -82,7 +82,6 @@ void WrtClient::OnResume() return; } m_widget->Resume(); - evas_object_focus_set(m_widget->GetCurrentWebview(), EINA_TRUE); m_widgetState = WidgetState_Running; } @@ -96,7 +95,6 @@ void WrtClient::OnPause() return; } m_widget->Suspend(); - evas_object_focus_set(m_widget->GetCurrentWebview(), EINA_FALSE); m_widgetState = WidgetState_Suspended; } @@ -117,8 +115,6 @@ void WrtClient::OnReset(bundle *b) return; } m_widget->Reset(); - elm_win_raise(m_windowData->m_win); - evas_object_focus_set(m_widget->GetCurrentWebview(), EINA_TRUE); m_widgetState = WidgetState_Running; } else { if (true == checkArgument()) -- 2.7.4