White patch is displayed while rotating device 69/90369/1
authorm.kawonczyk <m.kawonczyk@samsung.com>
Thu, 29 Sep 2016 13:04:23 +0000 (15:04 +0200)
committerm.kawonczyk <m.kawonczyk@samsung.com>
Thu, 29 Sep 2016 13:04:23 +0000 (15:04 +0200)
[Issue]        http://suprem.sec.samsung.net/jira/browse/TWF-2216
[Problem]      White patch is displayed while rotating device
[Solution]     Manually invoke rotation when browsing websites when
               browser receives "rotate,prepared" callback from
               webview.
[Verify]       Open any website, rotate device. Rotation should be
               smooth. Then use other views and check if rotations
               works as intended.

Change-Id: I21bcb527328543f27bc99ae86808afca6e3611bf

CMakeLists.txt
core/AbstractWebEngine/AbstractWebEngine.h
services/SimpleUI/SimpleUI.cpp
services/SimpleUI/SimpleUI.h
services/WebEngineService/WebEngineService.cpp
services/WebEngineService/WebView.cpp
services/WebEngineService/WebView.h
services/WebPageUI/WebPageUI.cpp
services/WebPageUI/WebPageUI.h

index c03f0a1..a56ceb1 100755 (executable)
@@ -29,18 +29,21 @@ option(TIZEN_BUILD "Build for Tizen. Default ON" ON)
 option(DYN_INT_LIBS "Buils internal libs as dynamic" ON)
 option(COVERAGE_STATS "Code coverage" OFF)
 
-#Enable C++11 support
+#Enable C++14 support
 include(CheckCXXCompilerFlag)
+CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
 CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
 
 
-if (COMPILER_SUPPORTS_CXX11)
+if(COMPILER_SUPPORTS_CXX14)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O0 -g -ggdb3")
+elseif(COMPILER_SUPPORTS_CXX11)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O0 -g -ggdb3")
-    elseif(COMPILER_SUPPORTS_CXX0X)
+elseif(COMPILER_SUPPORTS_CXX0X)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -O0 -g -ggdb3")
 else()
-    message(FATAL_ERROR "The Compiler ${CMAKE_CXX_COMPILER} doesn't support C++11")
+    message(FATAL_ERROR "The Compiler ${CMAKE_CXX_COMPILER} doesn't support C++14 nor C++11")
 endif()
 
 set(BOOST_LIBS regex filesystem system date_time)
index 710f84b..e33c85b 100755 (executable)
@@ -572,6 +572,11 @@ public:
     boost::signals2::signal<int()> getRotation;
 
     /**
+      Async signal to inform browser to finish rotation.
+     */
+    boost::signals2::signal<void ()> rotatePrepared;
+
+    /**
      * Unsecure connection to https host, do not even ask to confirm, just inform.
      */
     boost::signals2::signal<void()> unsecureConnection;
index 1e80ace..f5a3879 100755 (executable)
@@ -83,6 +83,7 @@ SimpleUI::SimpleUI()
     , m_favoritesLimit(0)
     , m_wvIMEStatus(false)
 #if PROFILE_MOBILE
+    , m_manualRotation(false)
     , m_current_angle(0)
     , m_temp_angle(0)
 #endif
@@ -112,6 +113,7 @@ SimpleUI::SimpleUI()
         static const int rots[] = {0, 90, 180, 270};
         elm_win_wm_rotation_available_rotations_set(main_window, rots, (sizeof(rots) / sizeof(int)));
         evas_object_smart_callback_add(main_window, "wm,rotation,changed", __orientation_changed, this);
+        enableManualRotation(false);
     } else
         BROWSER_LOGW("[%s:%d] Device does not support rotation.", __PRETTY_FUNCTION__, __LINE__);
 
@@ -186,7 +188,7 @@ int SimpleUI::exec(const std::string& _url, const std::string& _caller)
             initModelServices();
 
             //Push first view to stack.
-            m_viewManager.pushViewToStack(m_webPageUI.get());
+            pushViewToStack(m_webPageUI.get());
 #if PROFILE_MOBILE
             // Register H/W back key callback
             m_platformInputManager->registerHWKeyCallback(m_viewManager.getContent());
@@ -322,6 +324,7 @@ void SimpleUI::connectUISignals()
     m_webPageUI->focusWebView.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine<Evas_Object>::setFocus, m_webEngine.get()));
     m_webPageUI->unfocusWebView.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine<Evas_Object>::clearFocus, m_webEngine.get()));
 #if PROFILE_MOBILE
+    m_webPageUI->updateManualRotation.connect([this](){enableManualRotation(isManualRotation(m_viewManager.topOfStack()));});
     m_webPageUI->hideMoreMenu.connect(boost::bind(&SimpleUI::closeMoreMenu, this));
     m_webPageUI->getURIEntry().mobileEntryFocused.connect(boost::bind(&WebPageUI::mobileEntryFocused, m_webPageUI));
     m_webPageUI->getURIEntry().mobileEntryUnfocused.connect(boost::bind(&WebPageUI::mobileEntryUnfocused, m_webPageUI));
@@ -567,6 +570,7 @@ void SimpleUI::connectModelSignals()
     m_webEngine->createTabId.connect(boost::bind(&SimpleUI::onCreateTabId, this));
     m_webEngine->snapshotCaptured.connect(boost::bind(&SimpleUI::onSnapshotCaptured, this, _1, _2));
     m_webEngine->redirectedWebPage.connect(boost::bind(&SimpleUI::redirectedWebPage, this, _1, _2));
+    m_webEngine->rotatePrepared.connect(boost::bind(&SimpleUI::rotatePrepared, this));
     m_webEngine->switchToQuickAccess.connect(boost::bind(&SimpleUI::switchViewToQuickAccess, this));
     m_webEngine->setCertificatePem.connect(boost::bind(&services::CertificateContents::saveCertificateInfo, m_certificateContents, _1, _2));
     m_webEngine->setWrongCertificatePem.connect(boost::bind(&services::CertificateContents::saveWrongCertificateInfo, m_certificateContents, _1, _2));
@@ -606,6 +610,30 @@ void SimpleUI::connectModelSignals()
 #endif
 }
 
+void SimpleUI::pushViewToStack(interfaces::AbstractUIComponent* view)
+{
+    m_viewManager.pushViewToStack(view);
+#if PROFILE_MOBILE
+    enableManualRotation(isManualRotation(view));
+#endif
+}
+
+void SimpleUI::popTheStack()
+{
+    m_viewManager.popTheStack();
+#if PROFILE_MOBILE
+    enableManualRotation(isManualRotation(m_viewManager.topOfStack()));
+#endif
+}
+
+void SimpleUI::popStackTo(interfaces::AbstractUIComponent* view)
+{
+    m_viewManager.popStackTo(view);
+#if PROFILE_MOBILE
+    enableManualRotation(isManualRotation(view));
+#endif
+}
+
 #if PROFILE_MOBILE
 void SimpleUI::registerHWKeyCallback()
 {
@@ -658,14 +686,14 @@ void SimpleUI::switchViewToQuickAccess()
 
     m_webPageUI->switchViewToQuickAccess(m_quickAccess->getContent());
     m_webEngine->disconnectCurrentWebViewSignals();
-    m_viewManager.popStackTo(m_webPageUI.get());
+    popStackTo(m_webPageUI.get());
 }
 
 void SimpleUI::switchViewToIncognitoPage()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     m_webPageUI->switchViewToIncognitoPage();
-    m_viewManager.popStackTo(m_webPageUI.get());
+    popStackTo(m_webPageUI.get());
 }
 
 void SimpleUI::openNewTab(const std::string &uri, const std::string& title,
@@ -749,7 +777,7 @@ void SimpleUI::onOpenURL(const std::string& url, const std::string& title, bool
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_webPageUI) {
-        m_viewManager.popStackTo(m_webPageUI.get());
+        popStackTo(m_webPageUI.get());
         if (tabsCount() == 0 || m_webPageUI->stateEquals(WPUState::QUICK_ACCESS))
             openNewTab(url, title, boost::none, desktopMode, false, basic_webengine::TabOrigin::QUICKACCESS);
         else {
@@ -808,7 +836,7 @@ void SimpleUI::onBookmarkClicked(std::shared_ptr<tizen_browser::services::Bookma
         m_webPageUI->getURIEntry().clearFocus();
         closeBookmarkManagerUI();
     }
-    m_viewManager.popStackTo(m_webPageUI.get());
+    popStackTo(m_webPageUI.get());
 }
 
 void SimpleUI::onNewFolderClicked()
@@ -1022,7 +1050,7 @@ void SimpleUI::onBackPressed()
     } else if ((m_viewManager.topOfStack() == m_bookmarkDetailsUI.get())) {
         m_bookmarkDetailsUI->onBackPressed();
     } else if (m_viewManager.topOfStack() == m_bookmarkManagerUI.get()) {
-        m_viewManager.popTheStack();
+        popTheStack();
     } else if (m_viewManager.topOfStack() == nullptr) {
         switchViewToQuickAccess();
     } else if ((m_viewManager.topOfStack() == m_webPageUI.get())) {
@@ -1040,7 +1068,7 @@ void SimpleUI::onBackPressed()
         m_settingsUI->onBackKey();
 #endif
     } else {
-        m_viewManager.popTheStack();
+        popTheStack();
     }
 }
 
@@ -1081,22 +1109,48 @@ void SimpleUI::onMenuButtonPressed()
     showMoreMenu();
 }
 
+bool SimpleUI::isManualRotation(interfaces::AbstractUIComponent* view)
+{
+    WebPageUI *webPageUI = dynamic_cast<WebPageUI *>(view);
+    return (webPageUI && webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE));
+}
+
+void SimpleUI::enableManualRotation(bool enable)
+{
+    m_manualRotation = enable;
+    BROWSER_LOGD("[%s:%d]: %d", __PRETTY_FUNCTION__, __LINE__, m_manualRotation);
+    elm_win_wm_rotation_manual_rotation_done_set(main_window,
+        m_manualRotation ? EINA_TRUE : EINA_FALSE);
+}
+
+void SimpleUI::rotatePrepared()
+{
+    BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+    if (m_manualRotation && elm_win_wm_rotation_manual_rotation_done_get(main_window)) {
+        elm_win_wm_rotation_manual_rotation_done(main_window);
+        m_webPageUI->orientationChanged();
+        m_moreMenuUI->resetContent();
+    }
+}
+
 void SimpleUI::onRotation()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
 
     m_current_angle = m_temp_angle;
-    elm_win_rotation_with_resize_set(main_window, m_current_angle);
-    m_bookmarkDetailsUI->setLandscape((m_current_angle % 180) == 0);
-    m_moreMenuUI->resetContent();
-    m_bookmarkFlowUI->resetContent();
-    m_settingsUI->orientationChanged();
-    m_bookmarkManagerUI->orientationChanged();
-    m_webPageUI->orientationChanged();
-    m_tabUI->orientationChanged();
     m_webEngine->orientationChanged();
-    if (!m_popupVector.empty())
-        m_popupVector.back()->orientationChanged();
+    if (!m_manualRotation) {
+        m_bookmarkDetailsUI->setLandscape((m_current_angle % 180) == 0);
+        m_moreMenuUI->resetContent();
+        m_bookmarkFlowUI->resetContent();
+        m_settingsUI->orientationChanged();
+        m_bookmarkManagerUI->orientationChanged();
+        m_webPageUI->orientationChanged();
+        m_tabUI->orientationChanged();
+
+        if (!m_popupVector.empty())
+            m_popupVector.back()->orientationChanged();
+    }
 }
 
 void SimpleUI::__orientation_changed(void* data, Evas_Object*, void*)
@@ -1257,7 +1311,7 @@ void SimpleUI::showZoomUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if(! m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)) {
-        m_viewManager.popStackTo(m_webPageUI.get());
+        popStackTo(m_webPageUI.get());
         m_webPageUI->showTabUI.connect(boost::bind(&SimpleUI::closeZoomUI, this));
         m_webPageUI->showMoreMenu.connect(boost::bind(&SimpleUI::closeZoomUI, this));
         m_zoomUI->show(m_window.get());
@@ -1323,7 +1377,7 @@ void SimpleUI::closeFindOnPageUI()
 void SimpleUI::showTabUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(m_tabUI.get());
+    pushViewToStack(m_tabUI.get());
 
     if (!m_webPageUI->stateEquals(WPUState::QUICK_ACCESS) && m_webEngine->tabsCount() > 0 && m_webEngine->isLoading())
         onGenerateThumb(m_webEngine->currentTabId());
@@ -1337,7 +1391,7 @@ void SimpleUI::closeTabUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_tabUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
 }
 
 void SimpleUI::newTabClicked()
@@ -1352,7 +1406,7 @@ void SimpleUI::newTabClicked()
 void SimpleUI::tabClicked(const tizen_browser::basic_webengine::TabId& tabId)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.popStackTo(m_webPageUI.get());
+    popStackTo(m_webPageUI.get());
     m_webPageUI->toIncognito(m_webEngine->isPrivateMode(tabId));
     switchToTab(tabId);
 }
@@ -1480,7 +1534,7 @@ void SimpleUI::certPopupButtonClicked(PopupButtons button, std::shared_ptr<Popup
 void SimpleUI::showHistoryUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(m_historyUI.get());
+    pushViewToStack(m_historyUI.get());
     m_historyUI->addHistoryItems(m_historyService->getHistoryToday(),
             HistoryPeriod::HISTORY_TODAY);
     m_historyUI->addHistoryItems(m_historyService->getHistoryYesterday(),
@@ -1497,20 +1551,20 @@ void SimpleUI::closeHistoryUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_historyUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
 }
 
 void SimpleUI::showSettingsUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(m_settingsUI.get());
+    pushViewToStack(m_settingsUI.get());
 }
 
 void SimpleUI::closeSettingsUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_settingsUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
 }
 
 void SimpleUI::showMoreMenu()
@@ -1530,7 +1584,7 @@ void SimpleUI::showMoreMenu()
 #else
     bool desktopMode = m_webPageUI->stateEquals(WPUState::QUICK_ACCESS) ? m_quickAccess->isDesktopMode() : m_webEngine->isDesktopMode();
     m_moreMenuUI->setDesktopMode(desktopMode);
-    m_viewManager.pushViewToStack(m_moreMenuUI.get());
+    pushViewToStack(m_moreMenuUI.get());
     m_moreMenuUI->showCurrentTab();
 
     if (!m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)) {
@@ -1554,7 +1608,7 @@ void SimpleUI::closeMoreMenu()
         m_moreMenuUI->hideUI();
 #else
     if (m_viewManager.topOfStack() == m_moreMenuUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
     else
         BROWSER_LOGD("[%s:%d] WARNING!!! closeMoreMenu is not topOfStack", __PRETTY_FUNCTION__, __LINE__);
 #endif
@@ -1565,7 +1619,7 @@ void SimpleUI::switchToMobileMode()
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (!m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)) {
         m_webEngine->switchToMobileMode();
-        m_viewManager.popStackTo(m_webPageUI.get());
+        popStackTo(m_webPageUI.get());
         m_webEngine->reload();
     } else {
         m_quickAccess->setDesktopMode(false);
@@ -1593,7 +1647,7 @@ void SimpleUI::showBookmarkFlowUI(bool state)
 #endif
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
 #if PROFILE_MOBILE
-    m_viewManager.pushViewToStack(m_bookmarkFlowUI.get());
+    pushViewToStack(m_bookmarkFlowUI.get());
     std::string uri = m_webEngine->getURI();
     m_bookmarkFlowUI->setURL(uri);
     m_bookmarkFlowUI->setState(state);
@@ -1621,14 +1675,14 @@ void SimpleUI::closeBookmarkFlowUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_bookmarkFlowUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
 }
 #endif
 
 void SimpleUI::showBookmarkManagerUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(m_bookmarkManagerUI.get());
+    pushViewToStack(m_bookmarkManagerUI.get());
 #if PROFILE_MOBILE
     m_bookmarkManagerUI->addNewFolder();
 #endif
@@ -1647,7 +1701,7 @@ void SimpleUI::redirectedWebPage(const std::string& oldUrl, const std::string& n
 void SimpleUI::onBookmarkAllFolderClicked()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(m_bookmarkDetailsUI.get());
+    pushViewToStack(m_bookmarkDetailsUI.get());
     m_bookmarkDetailsUI->addBookmarks(m_favoriteService->getBookmarks(tizen_browser::services::ALL_BOOKMARKS_ID),
             _("IDS_BR_BODY_ALL"));
     m_bookmarkDetailsUI->showUI();
@@ -1656,7 +1710,7 @@ void SimpleUI::onBookmarkAllFolderClicked()
 void SimpleUI::onBookmarkSpecialFolderClicked()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(m_bookmarkDetailsUI.get());
+    pushViewToStack(m_bookmarkDetailsUI.get());
     m_bookmarkDetailsUI->addBookmarks(m_favoriteService->getBookmarks(m_storageService->getFoldersStorage().SpecialFolder),
                                     m_storageService->getFoldersStorage().getFolderName(m_storageService->getFoldersStorage().SpecialFolder));
     m_bookmarkDetailsUI->showUI();
@@ -1665,7 +1719,7 @@ void SimpleUI::onBookmarkSpecialFolderClicked()
 void SimpleUI::onBookmarkCustomFolderClicked(int folderId)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(m_bookmarkDetailsUI.get());
+    pushViewToStack(m_bookmarkDetailsUI.get());
     m_bookmarkDetailsUI->addBookmarks(m_favoriteService->getBookmarks(folderId), m_storageService->getFoldersStorage().getFolderName(folderId));
     m_bookmarkDetailsUI->showUI();
 }
@@ -1674,7 +1728,7 @@ void SimpleUI::closeBookmarkDetailsUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_bookmarkDetailsUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
     showBookmarkManagerUI();
 }
 
@@ -1682,7 +1736,7 @@ void SimpleUI::closeBookmarkManagerUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_bookmarkManagerUI.get())
-    m_viewManager.popTheStack();
+    popTheStack();
 }
 
 void SimpleUI::settingsDeleteSelectedData(const std::string& str)
index 7db3481..276832a 100755 (executable)
@@ -95,6 +95,9 @@ private:
     void initModelServices();
     void initUIServices();
     void connectModelSignals();
+    void pushViewToStack(interfaces::AbstractUIComponent* view);
+    void popTheStack();
+    void popStackTo(interfaces::AbstractUIComponent* view);
     void titleChanged(const std::string& title);
     void faviconChanged(tools::BrowserImagePtr favicon);
     void restoreLastSession();
@@ -291,6 +294,9 @@ private:
     void registerHWKeyCallback();
     void unregisterHWKeyCallback();
 
+    bool isManualRotation(interfaces::AbstractUIComponent* view);
+    void enableManualRotation(bool enable);
+    void rotatePrepared();
     void onRotation();
     bool isLandscape();
     int getRotation();
@@ -369,6 +375,7 @@ private:
     Evas_Object *main_window;
 #if PROFILE_MOBILE
     Evas_Object *m_conformant;
+    bool m_manualRotation;
     int m_current_angle;
     int m_temp_angle;
 #endif
index ffe9aa1..9eeb1b6 100755 (executable)
@@ -151,6 +151,7 @@ void WebEngineService::connectSignals(std::shared_ptr<WebView> webView)
     webView->setWrongCertificatePem.connect(boost::bind(&WebEngineService::_setWrongCertificatePem, this, _1, _2));
 #if PROFILE_MOBILE
     webView->getRotation.connect(boost::bind(&WebEngineService::_getRotation, this));
+    webView->rotatePrepared.connect([this](){rotatePrepared();});
     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);});
@@ -175,6 +176,7 @@ void WebEngineService::disconnectSignals(std::shared_ptr<WebView> webView)
     webView->redirectedWebPage.disconnect(boost::bind(&WebEngineService::_redirectedWebPage, this, _1, _2));
 #if PROFILE_MOBILE
     webView->getRotation.disconnect(boost::bind(&WebEngineService::_getRotation, this));
+    webView->rotatePrepared.disconnect_all_slots();
     webView->unsecureConnection.disconnect(boost::bind(&WebEngineService::_unsecureConnection, this));
     webView->findOnPage.disconnect(boost::bind(&WebEngineService::_findOnPage, this, _1));
     webView->fullscreenModeSet.disconnect_all_slots();
index fb5aa58..a71cde8 100755 (executable)
@@ -242,6 +242,8 @@ void WebView::registerCallbacks()
     evas_object_smart_callback_add(m_ewkView, "fullscreen,enterfullscreen", __fullscreen_enter_cb, this);
     evas_object_smart_callback_add(m_ewkView, "fullscreen,exitfullscreen", __fullscreen_exit_cb, this);
     ewk_context_vibration_client_callbacks_set(m_ewkContext, __vibration_cb, __vibration_cancel_cb, this);
+
+    evas_object_smart_callback_add(m_ewkView, "rotate,prepared", __rotate_prepared_cb, this);
 #endif
 
 }
@@ -281,6 +283,8 @@ void WebView::unregisterCallbacks()
     evas_object_smart_callback_del_full(m_ewkView, "fullscreen,enterfullscreen", __fullscreen_enter_cb, this);
     evas_object_smart_callback_del_full(m_ewkView, "fullscreen,exitfullscreen", __fullscreen_exit_cb, this);
     ewk_context_vibration_client_callbacks_set(m_ewkContext, NULL, NULL, this);
+
+    evas_object_smart_callback_del_full(m_ewkView, "rotate,prepared", __rotate_prepared_cb, this);
 #endif
 }
 
@@ -1418,6 +1422,17 @@ void WebView::__fullscreen_exit_cb(void *data, Evas_Object*, void*) {
     self->fullscreenModeSet(self->m_fullscreen);
 }
 
+void WebView::__rotate_prepared_cb(void * data, Evas_Object *, void *)
+{
+    BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+    if (data) {
+        auto *self = static_cast<WebView *>(data);
+        self->rotatePrepared();
+    } else {
+            BROWSER_LOGW("[%s] data = nullptr", __PRETTY_FUNCTION__);
+    }
+}
+
 #endif
 
 void WebView::setFocus()
index aaa99a7..97e0750 100755 (executable)
@@ -282,6 +282,8 @@ public:
     boost::signals2::signal<void (const std::string&, const std::string&)> setCertificatePem;
     boost::signals2::signal<void (const std::string&, const std::string&)> setWrongCertificatePem;
 
+    boost::signals2::signal<void ()> rotatePrepared;
+
     boost::signals2::signal<void (const std::string&, const std::string&)> redirectedWebPage;
     boost::signals2::signal<void()> unsecureConnection;
     boost::signals2::signal<void(bool)> fullscreenModeSet;
@@ -313,6 +315,7 @@ private:
     static void __contextmenu_selected_cb(void *data, Evas_Object *obj, void *event_info);
     static void __fullscreen_enter_cb(void *data, Evas_Object *obj, void *event_info);
     static void __fullscreen_exit_cb(void *data, Evas_Object *obj, void *event_info);
+    static void __rotate_prepared_cb(void *data, Evas_Object *obj, void *event_info);
 
     Eina_Bool handle_scheme(const char *uri);
     Eina_Bool launch_email(const char *uri);
index efb210c..953dc6f 100755 (executable)
@@ -209,6 +209,7 @@ void WebPageUI::setMainContent(Evas_Object* content)
 #endif
 #if PROFILE_MOBILE
     evas_object_smart_callback_add(content, "mouse,down", _content_clicked, this);
+    updateManualRotation();
 #endif
     evas_object_show(content);
 }
index 9080fba..d11e918 100755 (executable)
@@ -104,6 +104,7 @@ public:
     boost::signals2::signal<void ()> reloadPage;
     boost::signals2::signal<void ()> showTabUI;
 #if PROFILE_MOBILE
+    boost::signals2::signal<void ()> updateManualRotation;
     boost::signals2::signal<void ()> hideMoreMenu;
     boost::signals2::signal<void ()> qaOrientationChanged;
 #else