Add back-key exception during fullscreen by default video tag
authorJihoon Chung <jihoon.chung@samsaung.com>
Wed, 16 Oct 2013 05:48:09 +0000 (14:48 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Wed, 23 Oct 2013 14:37:32 +0000 (23:37 +0900)
[Issue#]     LINUXWRT-1035
[Problem]    In case of fullscreen is enabled by default video tag, back-key works to exit fullscreen.
             However, "tizenhwkey" event also dispatch to application.
[Cause]      Missed to consider.
[Solution]   Move current implementation from wrt-client to view_logic for early return before dispatch "tizenhwkey" event.
[Verification] Install test application attached LINUXWRT-1035.
               Launch application -> change video to fullscreen.
               Select back-key -> Application not terminate
[SCMRequest] N/A

Conflicts:
src/view/webkit/view_logic.cpp
src/wrt-client/wrt-client.cpp

Change-Id: I4c8f510281216d95ca170db047f07aeb61b022ab

src/api_new/user_delegates.h
src/view/webkit/view_logic.cpp
src/view/webkit/view_logic.h
src/wrt-client/wrt-client.cpp
src/wrt-client/wrt-client.h

index 4adbc12..13a95dd 100644 (file)
@@ -44,7 +44,7 @@ typedef DPL::FastDelegate1<bool, void> SuspendCB;
 typedef DPL::FastDelegate1<bool, void> ResetCB;
 typedef DPL::FastDelegate1<Evas_Object*, void> BufferUnsetCB;
 typedef DPL::FastDelegate1<Evas_Object*, void> BufferSetCB;
-typedef DPL::FastDelegate2<Evas_Object*, bool, void> EnterFullscreenCB;
+typedef DPL::FastDelegate1<Evas_Object*, void> EnterFullscreenCB;
 typedef DPL::FastDelegate1<Evas_Object*, void> ExitFullscreenCB;
 typedef DPL::FastDelegate1<bool, void> EditorclientImeCB;
 typedef DPL::FastDelegate1<int, void> OrientationCB;
index 954177e..ee167ed 100644 (file)
@@ -191,6 +191,7 @@ ViewLogic::ViewLogic() :
         ViewModule::OrientationSupport::DEFERRED_ORIENTATION_EMPTY),
     m_orientationThresholdTimer(NULL),
     m_isPopupReplyWait(false),
+    m_isFullscreenByPlatform(false),
     m_appsSupport(new ViewModule::AppsSupport()),
     m_vibrationSupport(new ViewModule::VibrationSupport()),
     m_webNotificationSupport(new ViewModule::WebNotificationSupport())
@@ -1447,13 +1448,12 @@ void ViewLogic::enterFullscreenCallback(
         This->m_ewkContext,
         "fullscreen");
 
-    bool isFullscreenByPlatform = false;
     if (eventInfo) {
-        isFullscreenByPlatform =
-            (*static_cast<Eina_Bool*>(eventInfo) == EINA_TRUE);
+        This->m_isFullscreenByPlatform =
+            *static_cast<Eina_Bool*>(eventInfo) == EINA_TRUE;
     }
     if (!This->m_cbs->enterFullscreen.empty()) {
-        This->m_cbs->enterFullscreen(obj, isFullscreenByPlatform);
+        This->m_cbs->enterFullscreen(obj);
     }
 }
 
@@ -1468,6 +1468,8 @@ void ViewLogic::exitFullscreenCallback(
     ViewLogicMessageSupport::setViewmodes(
         This->m_ewkContext,
         Message::ToInjectedBundle::SET_VIEWMODES_MSGBODY_EXIT);
+
+    This->m_isFullscreenByPlatform = false;
     if (!This->m_cbs->exitFullscreen.empty()) {
         This->m_cbs->exitFullscreen(obj);
     }
@@ -1967,6 +1969,14 @@ void ViewLogic::eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
     if (keyType == EA_CALLBACK_BACK) {
         Assert(obj);
 #if 0 // FIXME!!!! ewk_view_text_selection_clear has not landed yet
+        // Call fullscreen exit API
+        // In case of fullscreen is entered by platform(default video tag),
+        // automatically exit fullscreen when backkey is selected
+        if (This->m_isFullscreenByPlatform) {
+            ewk_view_fullscreen_exit(obj);
+            return;
+        }
+
         // Call text selection clear API
         // In case of current state is selection mode,
         // application doesn't need to handle back key
index 06173b2..4fe5ec9 100644 (file)
@@ -315,6 +315,7 @@ class ViewLogic : public ViewModule::IViewModule
     int m_deferredRotateAngle;
     Ecore_Timer* m_orientationThresholdTimer;
     bool m_isPopupReplyWait;
+    bool m_isFullscreenByPlatform;
 
     std::unique_ptr<ViewModule::AppsSupport> m_appsSupport;
     std::unique_ptr<ViewModule::VibrationSupport> m_vibrationSupport;
index e31c677..2f1ff46 100644 (file)
@@ -83,7 +83,6 @@ WrtClient::WrtClient(int argc, char **argv) :
     m_initialViewMode(VIEWMODE_TYPE_MAXIMIZED),
     m_currentViewMode(VIEWMODE_TYPE_MAXIMIZED),
     m_isWebkitFullscreen(false),
-    m_isFullscreenByPlatform(false),
     m_submodeSupport(new ClientModule::SubmodeSupport())
 {
     Touch();
@@ -344,16 +343,12 @@ void WrtClient::webCrashCallback()
         NextStepEvent());
 }
 
-void WrtClient::enterFullscreenCallback(Evas_Object* /*obj*/,
-                                        bool isFullscreenByPlatform)
+void WrtClient::enterFullscreenCallback(Evas_Object* /*obj*/)
 {
     // enter fullscreen
     m_windowData->toggleFullscreen(true);
     m_currentViewMode = VIEWMODE_TYPE_FULLSCREEN;
     m_isWebkitFullscreen = true;
-    if (isFullscreenByPlatform) {
-        m_isFullscreenByPlatform = true;
-    }
 }
 
 void WrtClient::exitFullscreenCallback(Evas_Object* /*obj*/)
@@ -362,7 +357,6 @@ void WrtClient::exitFullscreenCallback(Evas_Object* /*obj*/)
     m_windowData->toggleFullscreen(false);
     m_currentViewMode = m_initialViewMode;
     m_isWebkitFullscreen = false;
-    m_isFullscreenByPlatform = false;
 }
 
 void WrtClient::launchStep()
@@ -784,15 +778,6 @@ void WrtClient::hwkeyCallback(const std::string& key)
             // UX isn't confirmed
             // m_windowData->showCtxpopup();
         }
-    } else {
-        // packaged application
-        if (key == KeyName::BACK) {
-            if (m_isFullscreenByPlatform) {
-                // FIXME!!! This method has not yet landed in the tizen 3.0
-                //          webkit-efl source tree
-                //ewk_view_fullscreen_exit(m_widget->GetCurrentWebview());
-            }
-        }
     }
 }
 
index 18702d6..3066457 100644 (file)
@@ -127,7 +127,7 @@ class WrtClient :
     void progressFinishCallback();
     void webkitExitCallback();
     void webCrashCallback();
-    void enterFullscreenCallback(Evas_Object* obj, bool isFullscreenByPlatform);
+    void enterFullscreenCallback(Evas_Object* obj);
     void exitFullscreenCallback(Evas_Object* obj);
     void setLayout(Evas_Object* newBuffer);
     void unsetLayout(Evas_Object* currentBuffer);
@@ -149,7 +149,6 @@ class WrtClient :
     std::string m_initialViewMode;
     std::string m_currentViewMode;
     bool m_isWebkitFullscreen;
-    bool m_isFullscreenByPlatform;
 
     std::unique_ptr<ClientModule::SubmodeSupport> m_submodeSupport;
 };