Change action of appservice in case that serviced page is same to current page of...
authorYunchan Cho <yunchan.cho@samsung.com>
Tue, 20 Nov 2012 09:27:58 +0000 (18:27 +0900)
committerYunchan Cho <yunchan.cho@samsung.com>
Fri, 23 Nov 2012 04:25:51 +0000 (13:25 +0900)
[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
src/wrt-client/wrt-client.cpp

index e58cc91..2055dc5 100644 (file)
@@ -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
index df4a3bd..c314618 100755 (executable)
@@ -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())