Fix fullscreen issue 54/94254/1
authorKamil Nowac <k.nowac@samsung.com>
Thu, 22 Sep 2016 08:51:08 +0000 (10:51 +0200)
committerHyeKyoung Hwang <cookie@samsung.com>
Fri, 28 Oct 2016 02:06:18 +0000 (11:06 +0900)
[Issue]    N/A
[Problem]  Fullscreen while playing a video
[Solution] Hide url bar
[Verify]   Open youtube video in fullscreen
           url bar should be hidden

Change-Id: I580615f9682d3757b2244ac6ca3ef51102b3723a

core/AbstractWebEngine/AbstractWebEngine.h
services/SimpleUI/SimpleUI.cpp
services/WebEngineService/WebEngineService.cpp
services/WebEngineService/WebView.cpp
services/WebEngineService/WebView.h
services/WebPageUI/WebPageUI.cpp
services/WebPageUI/WebPageUI.h
services/WebPageUI/edc/WebPageUI_mob.edc

index 5bce6330d75a07ea338576a351d3848032dc6fb4..693e2f0ddf7955a3ac947d749165b535d918529c 100644 (file)
@@ -395,6 +395,11 @@ public:
      */
     boost::signals2::signal<void ()> minimizeBrowser;
 
+    /**
+    * Switch fullscreenmode.
+    */
+    boost::signals2::signal<void(bool)> fullscreenModeSet;
+
     /**
      * FavIcon of current page changed
      */
index 06b85f9f8f8961cda2b222aebc45660265f0986f..217a7b9e5da99455252dddd784624875ce50356e 100644 (file)
@@ -329,6 +329,7 @@ void SimpleUI::connectUISignals()
     m_webPageUI->qaOrientationChanged.connect(boost::bind(&QuickAccess::orientationChanged, m_quickAccess));
     m_webPageUI->getURIEntry().secureIconClicked.connect(boost::bind(&SimpleUI::showCertificatePopup, this));
     m_webPageUI->getURIEntry().isValidCert.connect(boost::bind(&services::CertificateContents::isValidCertificate, m_certificateContents, _1));
+    m_webEngine->fullscreenModeSet.connect(boost::bind(&WebPageUI::fullscreenModeSet, m_webPageUI.get(), _1));
 #endif
 
     M_ASSERT(m_quickAccess.get());
index 142e1ee1858cf887e2444dc5937486765237f703..5d918b64bd0edcd17851617db0859efa02e20527 100755 (executable)
@@ -142,6 +142,7 @@ void WebEngineService::connectSignals(std::shared_ptr<WebView> webView)
     webView->getRotation.connect(boost::bind(&WebEngineService::_getRotation, this));
     webView->unsecureConnection.connect(boost::bind(&WebEngineService::_unsecureConnection, this));
     webView->findOnPage.connect(boost::bind(&WebEngineService::_findOnPage, this, _1));
+    webView->fullscreenModeSet.connect([this](bool state){fullscreenModeSet(state);});
 #endif
 }
 
@@ -165,6 +166,7 @@ void WebEngineService::disconnectSignals(std::shared_ptr<WebView> webView)
     webView->getRotation.disconnect(boost::bind(&WebEngineService::_getRotation, this));
     webView->unsecureConnection.disconnect(boost::bind(&WebEngineService::_unsecureConnection, this));
     webView->findOnPage.disconnect(boost::bind(&WebEngineService::_findOnPage, this, _1));
+    webView->fullscreenModeSet.disconnect_all_slots();
 #endif
 }
 
index f38148711a5b884b89575bf85f439128a68a1c1c..139bcc22bc8d7a2910fef570af6e357295c2566a 100755 (executable)
@@ -1421,6 +1421,7 @@ void WebView::__fullscreen_enter_cb(void *data, Evas_Object*, void*) {
 
     auto self = static_cast<WebView*>(data);
     self->m_fullscreen = true;
+    self->fullscreenModeSet(self->m_fullscreen);
 }
 
 void WebView::__fullscreen_exit_cb(void *data, Evas_Object*, void*) {
@@ -1428,6 +1429,7 @@ void WebView::__fullscreen_exit_cb(void *data, Evas_Object*, void*) {
 
     auto self = static_cast<WebView*>(data);
     self->m_fullscreen = false;
+    self->fullscreenModeSet(self->m_fullscreen);
 }
 
 #endif
index 688616df30cb59eaf64ea17aee8c229366ea5e85..f96015794d158845bb3f9cd624c0fa6a7e37313d 100644 (file)
@@ -283,6 +283,7 @@ public:
 
     boost::signals2::signal<void (const std::string&, const std::string&)> redirectedWebPage;
     boost::signals2::signal<void()> unsecureConnection;
+    boost::signals2::signal<void(bool)> fullscreenModeSet;
 
 protected:
     std::string getRedirectedURL() {return m_redirectedURL;};
index e07213aff52277b86c93055fa6bc0e90a8230ebb..0c6227f1ed683bce2b8d14a964e1d23e19aef6df 100755 (executable)
@@ -48,7 +48,10 @@ WebPageUI::WebPageUI()
     , m_WebPageUIvisible(false)
 #if PROFILE_MOBILE && GESTURE
     , m_gestureLayer(nullptr)
+#endif
+#if PROFILE_MOBILE
     , m_uriBarHidden(false)
+    , m_fullscreen(false)
 #endif
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -419,6 +422,20 @@ void WebPageUI::orientationChanged()
         qaOrientationChanged();
     }
 }
+
+void WebPageUI::fullscreenModeSet(bool state)
+{
+    BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+    auto landscape = isLandscape();
+    m_fullscreen = state;
+    if (!state)
+        elm_object_signal_emit(m_mainLayout, "show_uri_bar", "ui");
+    else if (landscape && state) {
+        (*landscape) ?
+            elm_object_signal_emit(m_mainLayout, "hide_uri_bar_landscape", "ui") :
+            elm_object_signal_emit(m_mainLayout, "hide_uri_bar_vertical", "ui");
+    }
+}
 #endif
 
 void WebPageUI::createLayout()
index a189f97c692a2da2f350254ac6e1112fc9a5e5b9..850dfaba6d9d22329bc23b27c87287767024d7af 100644 (file)
@@ -56,6 +56,7 @@ public:
     void createDummyButton();
 #if PROFILE_MOBILE
     virtual void orientationChanged() override;
+    void fullscreenModeSet(bool state);
 #endif
     void loadStarted();
     void progressChanged(double progress);
@@ -184,10 +185,13 @@ private:
 
 #if PROFILE_MOBILE && GESTURE
     Evas_Object* m_gestureLayer;
-    bool m_uriBarHidden;
     static const int SINGLE_FINGER = 1;
     static const int SWIPE_MOMENTUM_TRESHOLD = 400;
 #endif
+#if PROFILE_MOBILE
+    bool m_uriBarHidden;
+    bool m_fullscreen;
+#endif
 };
 
 
index f6e41796d5daf0b360cd52a44a6dc5f9508b3851..74b58071fac3e8cf930ff94bbbf27a29196fbb53 100644 (file)
@@ -111,12 +111,12 @@ collections { base_scale: 2.6;
                 description {
                     state: "hidden_vertical" 0.0;
                     inherit: "default" 0.0;
-                    rel1 {relative: 0.0 -URI_BG_HEIGHT/1228; to:"bg";}
+                    rel1 {relative: 0.0 -2*URI_BG_HEIGHT/1228; to:"bg";}
                 }
                 description {
                     state: "hidden_landscape" 0.0;
                     inherit: "default" 0.0;
-                    rel1 {relative: 0.0 -URI_BG_HEIGHT/668; to:"bg";}
+                    rel1 {relative: 0.0 -2*URI_BG_HEIGHT/668; to:"bg";}
                 }
             }
             ADD_SPACER_OVER("left_spacer", "uri_bar_bg", 16, URI_BG_HEIGHT)