White patch is displayed while rotating device 09/90509/2
authorm.kawonczyk <m.kawonczyk@samsung.com>
Fri, 30 Sep 2016 09:25:42 +0000 (11:25 +0200)
committerMaciej Kawo?czyk <m.kawonczyk@samsung.com>
Fri, 30 Sep 2016 09:30:27 +0000 (02:30 -0700)
[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: I66ae5684ae70f51dc1e40da556930abb39e24ad4

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

index ac032bd38b6e7035e5adce167bf5ee06d301e0f4..a0d54dccbabdb7e657e95a74f82843b72c71e8fb 100644 (file)
@@ -271,7 +271,6 @@ public:
      */
     virtual int getZoomFactor()const = 0;
 
-
     /**
      * @brief Sets zoom factor in percentage
      *
@@ -332,12 +331,10 @@ public:
      */
     virtual void backButtonClicked() = 0;
 
-#if PROFILE_MOBILE
     /**
      * @brief clear text selection or exit full screen when more key is pressed
      */
     virtual void moreKeyPressed() = 0;
-#endif
 
     /**
      * @brief Switch current view to mobile mode
@@ -575,7 +572,6 @@ public:
     boost::signals2::signal<void (std::string)> iconDownload;
 #endif
 
-#if PROFILE_MOBILE
     /**
      * Register H/W back key callback for the current webview
      */
@@ -591,11 +587,15 @@ 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;
-#endif
 };
 
 } /* end of basic_webengine */
index fa2c93d7f5972e944254aec204bc4c34331eb1d6..ce55bcc5f3742b2193a33a6e213140f5893bfc07 100755 (executable)
@@ -62,12 +62,7 @@ const std::string HomePageURL = "about:home";
 const std::string ResetBrowserPopupMsg = "Do you really want to reset Browser?" \
                                          " If you press Reset, delete all data" \
                                          " and return to initial setting.";
-const int SCALE_FACTOR =
-#if PROFILE_MOBILE
-        720;
-#else
-        1920;
-#endif
+const int SCALE_FACTOR = 720;
 
 SimpleUI::SimpleUI()
     : AbstractMainWindow()
@@ -86,6 +81,7 @@ SimpleUI::SimpleUI()
 #if PWA
     , m_pwa()
 #endif
+    , m_manualRotation(false)
     , m_current_angle(0)
     , m_temp_angle(0)
 {
@@ -109,10 +105,11 @@ SimpleUI::SimpleUI()
 
     elm_win_resize_object_add(main_window, m_viewManager.getConformant());
     evas_object_show(main_window);
-#if PROFILE_MOBILE
+
     if (elm_win_wm_rotation_supported_get(main_window)) {
         rotationType(rotationLock::noLock);
         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__);
 
@@ -120,7 +117,6 @@ SimpleUI::SimpleUI()
     // determine if keyboard has been shown. I think it is possible to unify it with below callbacks.
     evas_object_smart_callback_add(m_viewManager.getConformant(), "virtualkeypad,state,on", onUrlIMEOpened, this);
     evas_object_smart_callback_add(m_viewManager.getConformant(), "virtualkeypad,state,off",onUrlIMEClosed, this);
-#endif
 }
 
 SimpleUI::~SimpleUI() {
@@ -141,10 +137,8 @@ void SimpleUI::resume()
     }
     m_webEngine->preinitializeWebViewCache();
     m_webEngine->resume();
-#if PROFILE_MOBILE
     if (m_findOnPageUI && m_findOnPageUI->isVisible())
         m_findOnPageUI->show_ime();
-#endif
 }
 
 void SimpleUI::destroyUI()
@@ -194,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());
 
             // Register H/W back key callback
             m_platformInputManager->registerHWKeyCallback(m_viewManager.getContent());
@@ -368,6 +362,7 @@ void SimpleUI::connectWebPageSignals()
     m_webPageUI->unfocusWebView.connect(boost::bind(&basic_webengine::AbstractWebEngine::clearFocus, m_webEngine.get()));
     m_webPageUI->bookmarkManagerClicked.connect(boost::bind(&SimpleUI::showBookmarkManagerUI, this,
         m_favoriteService->getRoot(), BookmarkManagerState::Default));
+    m_webPageUI->updateManualRotation.connect([this](){enableManualRotation(isManualRotation(m_viewManager.topOfStack()));});
     m_webPageUI->getWindow.connect(boost::bind(&SimpleUI::getMainWindow, this));
     m_webPageUI->isBookmark.connect(boost::bind(&SimpleUI::checkBookmark, this));
     m_webPageUI->deleteBookmark.connect(boost::bind(&SimpleUI::deleteBookmark, this));
@@ -571,6 +566,7 @@ void SimpleUI::connectWebEngineSignals()
     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));
@@ -692,7 +688,24 @@ void SimpleUI::initModelServices()
     m_certificateContents->init();
 }
 
-#if PROFILE_MOBILE
+void SimpleUI::pushViewToStack(interfaces::AbstractUIComponent* view)
+{
+    m_viewManager.pushViewToStack(view);
+    enableManualRotation(isManualRotation(view));
+}
+
+void SimpleUI::popTheStack()
+{
+    m_viewManager.popTheStack();
+    enableManualRotation(isManualRotation(m_viewManager.topOfStack()));
+}
+
+void SimpleUI::popStackTo(interfaces::AbstractUIComponent* view)
+{
+    m_viewManager.popStackTo(view);
+    enableManualRotation(isManualRotation(view));
+}
+
 void SimpleUI::registerHWKeyCallback()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -704,8 +717,6 @@ void SimpleUI::unregisterHWKeyCallback()
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     m_platformInputManager->unregisterHWKeyCallback(m_webEngine->getLayout());
 }
-#endif
-
 
 void SimpleUI::switchViewToWebPage()
 {
@@ -736,14 +747,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,
@@ -809,7 +820,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 {
@@ -867,7 +878,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());
     }
 }
 
@@ -889,7 +900,7 @@ void SimpleUI::onBookmarkEdit(std::shared_ptr<tizen_browser::services::BookmarkI
         m_bookmarkFlowUI->setState(true);
         m_bookmarkFlowUI->setTitle(bookmarkItem->getTitle());
         m_bookmarkFlowUI->setFolder(m_favoriteService->getBookmarkItem(bookmarkItem->getParent()));
-        m_viewManager.pushViewToStack(m_bookmarkFlowUI.get());
+        pushViewToStack(m_bookmarkFlowUI.get());
     }
 }
 
@@ -968,7 +979,6 @@ void SimpleUI::addQuickAccessItem(const std::string& name)
     showQuickAccess();
 }
 
-#if PROFILE_MOBILE
 void SimpleUI::onDeleteFolderClicked(const std::string& folder_name)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -1028,7 +1038,6 @@ void SimpleUI::onUrlIMEClosed(void* data, Evas_Object*, void*)
     self->m_webPageUI->showBottomBar(true);
     self->setwvIMEStatus(false);
 }
-#endif
 
 void SimpleUI::onSnapshotCaptured(std::shared_ptr<tools::BrowserImage> snapshot, tools::SnapshotType snapshot_type)
 {
@@ -1109,15 +1118,9 @@ void SimpleUI::onXF86BackPressed()
 void SimpleUI::onBackPressed()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-#if PROFILE_MOBILE
     if (m_findOnPageUI->isVisible())
         closeFindOnPageUI();
     else
-#else
-    if (m_zoomUI->isVisible()) {
-        m_zoomUI->escapeZoom();
-    } else
-#endif
     if (m_wvIMEStatus) {    // if IME opened
         return;
     } else if (m_popupVector.size() > 0) {
@@ -1141,7 +1144,7 @@ void SimpleUI::onBackPressed()
     } else if (m_viewManager.topOfStack() == m_settingsUI.get()) {
         closeSettingsUI();
     } else {
-        m_viewManager.popTheStack();
+        popTheStack();
     }
 }
 
@@ -1169,13 +1172,6 @@ void SimpleUI::dismissPopup(interfaces::AbstractPopup* popup)
     }
 }
 
-#if !PROFILE_MOBILE
-void SimpleUI::onEscapePressed()
-{
-    BROWSER_LOGD("[%s]", __func__);
-    m_zoomUI->escapeZoom();
-}
-#else
 void SimpleUI::onMenuButtonPressed()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -1184,20 +1180,45 @@ void SimpleUI::onMenuButtonPressed()
         view->showContextMenu();
 }
 
+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();
+    }
+}
+
 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_bookmarkFlowUI->orientationChanged();
-    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_bookmarkFlowUI->orientationChanged();
+        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*)
@@ -1245,8 +1266,6 @@ void SimpleUI::rotationType(rotationLock lock)
     elm_win_wm_rotation_available_rotations_set( main_window, const_cast<const int*>(rots), size);
 }
 
-#endif
-
 Evas_Object* SimpleUI::getMainWindow()
 {
     return main_window;
@@ -1284,10 +1303,8 @@ void SimpleUI::loadStarted()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     m_webPageUI->loadStarted();
-#if PROFILE_MOBILE
     if (m_findOnPageUI->isVisible())
         closeFindOnPageUI();
-#endif
 }
 
 void SimpleUI::progressChanged(double progress)
@@ -1354,52 +1371,11 @@ void SimpleUI::onURLEntryEditedByUser(const std::shared_ptr<std::string> editedU
     m_webPageUI->getUrlHistoryList()->onURLEntryEditedByUser(editedUrl, result);
 }
 
-#if !PROFILE_MOBILE
-void SimpleUI::onRedKeyPressed()
-{
-    m_webPageUI->onRedKeyPressed();
-}
-
-void SimpleUI::onYellowKeyPressed()
-{
-    m_webPageUI->onYellowKeyPressed();
-}
-
-void SimpleUI::showZoomUI()
-{
-    BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    if(! m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)) {
-        m_viewManager.popStackTo(m_webPageUI.get());
-        m_webPageUI->showTabUI.connect(boost::bind(&SimpleUI::closeZoomUI, this));
-        m_zoomUI->show(m_window.get());
-    }
-}
-
-void SimpleUI::closeZoomUI()
-{
-    M_ASSERT(m_zoomUI);
-    m_zoomUI->hideUI();
-}
-
-void SimpleUI::setZoomFactor(int level)
-{
-    BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__);
-    m_webEngine->setZoomFactor(level);
-}
-
-int SimpleUI::getZoomFactor()
-{
-    BROWSER_LOGD("[%s:%d] %d", __PRETTY_FUNCTION__, __LINE__, m_webEngine->getZoomFactor());
-    return m_webEngine->getZoomFactor();
-}
-#endif
-
 void SimpleUI::scrollView(const int& dx, const int& dy)
 {
     m_webEngine->scrollView(dx, dy);
 }
 
-#if PROFILE_MOBILE
 void SimpleUI::showFindOnPageUI(const std::string& str)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -1422,12 +1398,11 @@ void SimpleUI::closeFindOnPageUI()
     if (m_findOnPageUI)
         m_findOnPageUI->hideUI();
 }
-#endif
 
 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 &&
@@ -1444,7 +1419,7 @@ void SimpleUI::closeTabUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_tabUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
 }
 
 void SimpleUI::refetchTabUIData() {
@@ -1466,7 +1441,7 @@ void SimpleUI::tabClicked(const tizen_browser::basic_webengine::TabId& tabId)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     switchToTab(tabId);
-    m_viewManager.popStackTo(m_webPageUI.get());
+    popStackTo(m_webPageUI.get());
 }
 
 void SimpleUI::closeTabsClicked(const tizen_browser::basic_webengine::TabId& tabId)
@@ -1480,7 +1455,6 @@ int SimpleUI::tabsCount()
     return m_webEngine->tabsCount();
 }
 
-#if PROFILE_MOBILE
 void SimpleUI::handleConfirmationRequest(basic_webengine::WebConfirmationPtr webConfirmation)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -1549,7 +1523,6 @@ void SimpleUI::showCertificatePopup(const std::string& host, const std::string&
     popup->popupDismissed.connect(boost::bind(&SimpleUI::dismissPopup, this, _1));
     popup->show();
 }
-#endif
 
 void SimpleUI::certPopupButtonClicked(PopupButtons button, std::shared_ptr<PopupData> popupData)
 {
@@ -1573,9 +1546,7 @@ void SimpleUI::certPopupButtonClicked(PopupButtons button, std::shared_ptr<Popup
             break;
         case VIEW_CERTIFICATE:
         {
-#if PROFILE_MOBILE
             showCertificatePopup(certPopupData->cert->getURI(), certPopupData->cert->getPem(), services::CertificateContents::UNSECURE_HOST_UNKNOWN);
-#endif
             break;
         }
         default:
@@ -1605,7 +1576,7 @@ void SimpleUI::closeHistoryUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_historyUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
 }
 
 void SimpleUI::showSettings(unsigned s)
@@ -1613,13 +1584,13 @@ void SimpleUI::showSettings(unsigned s)
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     m_settingsManager->init(m_viewManager.getContent());
     m_settingsUI = m_settingsManager->getView(static_cast<SettingsMainOptions>(s));
-    m_viewManager.pushViewToStack(m_settingsUI.get());
+    pushViewToStack(m_settingsUI.get());
 }
 
 void SimpleUI::closeSettingsUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.popTheStack();
+    popTheStack();
 }
 
 void SimpleUI::onDefSearchEngineClicked()
@@ -1723,7 +1694,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);
@@ -1745,7 +1716,7 @@ void SimpleUI::editQuickAccess()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     m_quickAccess->editQuickAccess();
-    m_viewManager.pushViewToStack(m_webPageUI->getQuickAccessEditUI().get());
+    pushViewToStack(m_webPageUI->getQuickAccessEditUI().get());
 }
 
 void SimpleUI::addQuickAccess()
@@ -1789,14 +1760,14 @@ void SimpleUI::showBookmarkFlowUI()
         m_bookmarkFlowUI->setFolder(m_favoriteService->getRoot());
     }
 
-    m_viewManager.pushViewToStack(m_bookmarkFlowUI.get());
+    pushViewToStack(m_bookmarkFlowUI.get());
 }
 
 void SimpleUI::closeBookmarkFlowUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     if (m_viewManager.topOfStack() == m_bookmarkFlowUI.get())
-        m_viewManager.popTheStack();
+        popTheStack();
 }
 
 void SimpleUI::showBookmarkManagerUI(std::shared_ptr<services::BookmarkItem> parent,
@@ -1804,7 +1775,7 @@ void SimpleUI::showBookmarkManagerUI(std::shared_ptr<services::BookmarkItem> par
 {
     BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__);
     m_bookmarkManagerUI->setState(state);
-    m_viewManager.pushViewToStack(m_bookmarkManagerUI.get());
+    pushViewToStack(m_bookmarkManagerUI.get());
     m_bookmarkManagerUI->addBookmarkItems(parent,
         m_favoriteService->getAllBookmarkItems(parent->getId()));
 }
@@ -1834,7 +1805,7 @@ void SimpleUI::showHomePage()
         stateString.erase(it, Translations::CurrentPage.length());
     }
     auto url = m_webPageUI->getURIEntry().rewriteURI(stateString);
-    m_viewManager.popStackTo(m_webPageUI.get());
+    popStackTo(m_webPageUI.get());
     openNewTab(url);
 }
 
@@ -1849,7 +1820,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::map<SettingsDelPersDataOptions, bool>& options)
@@ -1864,15 +1835,9 @@ void SimpleUI::settingsDeleteSelectedData(const std::map<SettingsDelPersDataOpti
         }
     }
     if (isSelected) {
-#if PROFILE_MOBILE
            TextPopup* popup = TextPopup::createPopup(m_viewManager.getContent());
            popup->addButton(OK);
            popup->addButton(CANCEL);
-#else
-           SimplePopup* popup = SimplePopup::createPopup(m_viewManager.getContent());
-           popup->addButton(OK);
-           popup->addButton(CANCEL);
-#endif
            popup->buttonClicked.connect(boost::bind(&SimpleUI::onDeleteSelectedDataButton, this, _1, options));
            popup->setTitle("Delete");
            popup->setMessage("The selected web browsing data will be deleted.");
@@ -1916,11 +1881,7 @@ void SimpleUI::onDeleteSelectedDataButton(const PopupButtons& button, const std:
     }
 }
 
-#if PROFILE_MOBILE
 void SimpleUI::tabLimitPopupButtonClicked(PopupButtons button)
-#else
-void SimpleUI::tabLimitPopupButtonClicked(PopupButtons button, std::shared_ptr< PopupData > /*popupData */)
-#endif
 {
     if (button == CLOSE_TAB) {
         BROWSER_LOGD("[%s]: CLOSE TAB", __func__);
@@ -1939,15 +1900,9 @@ bool SimpleUI::checkIfCreate()
     int tabs = m_webEngine->tabsCount();
 
     if (tabs >= m_tabLimit) {
-#if PROFILE_MOBILE
         TextPopup* popup = TextPopup::createPopup(m_viewManager.getContent());
         popup->addButton(OK);
         popup->buttonClicked.connect(boost::bind(&SimpleUI::tabLimitPopupButtonClicked, this, _1));
-#else
-        SimplePopup *popup = SimplePopup::createPopup(m_viewManager.getContent());
-        popup->addButton(OK);
-        popup->buttonClicked.connect(boost::bind(&SimpleUI::tabLimitPopupButtonClicked, this, _1, _2));
-#endif
         popup->setTitle(_("Maximum tab count reached"));
         popup->setMessage("Close other tabs to open another new tab");
         popup->popupShown.connect(boost::bind(&SimpleUI::showPopup, this, _1));
@@ -2008,13 +1963,13 @@ void SimpleUI::searchWebPage(std::string &text, int flags)
 void SimpleUI::showPasswordUI()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.pushViewToStack(&(m_tabUI->getPasswordUI()));
+    pushViewToStack(&(m_tabUI->getPasswordUI()));
 }
 
 void SimpleUI::closeTopView()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-    m_viewManager.popTheStack();
+    popTheStack();
 }
 
 void SimpleUI::onFirstSecretMode()
index 0fe4ac482bf7bcbdc50c5ca4f87e1db0e3dfdbf3..6a388236d6b47e061241af11ff45c5bebc267818 100644 (file)
@@ -103,6 +103,9 @@ private:
     void initModelServices();
     void initUIServices();
     void connectModelSignals();
+    void pushViewToStack(interfaces::AbstractUIComponent* view);
+    void popTheStack();
+    void popStackTo(interfaces::AbstractUIComponent* view);
     void faviconChanged(tools::BrowserImagePtr favicon);
     void restoreLastSession();
     Evas_Object* createWebLayout(Evas_Object* parent);
@@ -129,17 +132,10 @@ private:
     void windowCreated();
     void minimizeBrowser();
 
-#if PROFILE_MOBILE
     void openNewTab(const std::string &uri, const std::string& title =
             std::string(), const boost::optional<int> adaptorId = boost::none,
             bool desktopMode = false, bool incognitoMode = false,
             basic_webengine::TabOrigin origin = basic_webengine::TabOrigin::UNKNOWN);
-#else
-    void openNewTab(const std::string &uri, const std::string& title =
-            std::string(), const boost::optional<int> adaptorId = boost::none,
-            bool desktopMode = true, bool incognitoMode = false,
-            basic_webengine::TabOrigin origin = basic_webengine::TabOrigin::UNKNOWN);
-#endif
 
     void switchToTab(const tizen_browser::basic_webengine::TabId& tabId);
     void newTabClicked();
@@ -160,14 +156,12 @@ private:
     void onBookmarkDeleted(std::shared_ptr<tizen_browser::services::BookmarkItem> bookmarkItem);
     void onNewFolderClicked(int parent);
     void onNewFolderPopupClick(const std::string& folder_name, int parent);
-#if PROFILE_MOBILE
     void onDeleteFolderClicked(const std::string& folder_name);
     void onRemoveFoldersClicked(std::vector<std::shared_ptr<services::BookmarkItem>> items);
     void onEditFolderPopupClicked(const std::string& newName, std::shared_ptr<services::BookmarkItem> item);
     void onDeleteFolderPopupClicked(PopupButtons button);
     static void onUrlIMEOpened(void* data, Evas_Object*, void*);
     static void onUrlIMEClosed(void* data, Evas_Object*, void*);
-#endif
 
     void onHistoryRemoved(const std::string& uri);
     void onOpenURL(std::shared_ptr<tizen_browser::services::HistoryItem> historyItem, bool desktopMode);
@@ -197,13 +191,8 @@ private:
     void certPopupButtonClicked(PopupButtons button, std::shared_ptr<PopupData> popupData);
 
     void onActionTriggered(const Action& action);
-#if PROFILE_MOBILE
     void onMenuButtonPressed();
     void handleConfirmationRequest(basic_webengine::WebConfirmationPtr webConfirmation);
-#else
-    void onRedKeyPressed();
-    void onYellowKeyPressed();
-#endif
     void setwvIMEStatus(bool status);
 
     sharedAction m_showBookmarkManagerUI;
@@ -254,15 +243,6 @@ private:
     void settingsOverrideUseragent(const std::string& userAgent);
     void onOverrideUseragentButton(const std::string& newUA);
 
-#if !PROFILE_MOBILE
-    /**
-     * @brief show Zoom Menu
-     */
-    void showZoomUI();
-    void closeZoomUI();
-    void setZoomFactor(int level);
-    int getZoomFactor();
-#endif
     void scrollView(const int& dx, const int& dy);
 
     void showTabUI();
@@ -295,6 +275,9 @@ private:
     void registerHWKeyCallback();
     void unregisterHWKeyCallback();
 
+    bool isManualRotation(interfaces::AbstractUIComponent* view);
+    void enableManualRotation(bool enable);
+    void rotatePrepared();
     void onRotation();
     bool isLandscape();
     int getRotation();
@@ -334,12 +317,7 @@ private:
     void onDeleteSelectedDataButton(const PopupButtons& button, const std::map<SettingsDelPersDataOptions, bool>& options);
     void onDeleteMostVisitedButton(std::shared_ptr<PopupData> popupData);
     void onResetBrowserButton(PopupButtons button, std::shared_ptr<PopupData> popupData);
-#if PROFILE_MOBILE
     void tabLimitPopupButtonClicked(PopupButtons button);
-#else
-    void tabLimitPopupButtonClicked(PopupButtons button, std::shared_ptr< PopupData > /*popupData*/);
-    void onEscapePressed();
-#endif
     int tabsCount();
 
     void onReturnPressed(MenuButton *m);
@@ -362,11 +340,7 @@ private:
     services::TabServicePtr m_tabService;
 
     std::shared_ptr<BookmarkFlowUI> m_bookmarkFlowUI;
-#if PROFILE_MOBILE
     std::shared_ptr<FindOnPageUI> m_findOnPageUI;
-#else
-    std::shared_ptr<tizen_browser::base_ui::ZoomUI> m_zoomUI;
-#endif
     std::shared_ptr<services::CertificateContents> m_certificateContents;
     std::shared_ptr<BookmarkManagerUI> m_bookmarkManagerUI;
     std::shared_ptr<QuickAccess> m_quickAccess;
@@ -391,6 +365,7 @@ private:
 #endif
     SharedNaviframeWrapper m_QAEditNaviframe;
     Evas_Object *m_conformant;
+    bool m_manualRotation;
     int m_current_angle;
     int m_temp_angle;
     bool m_isSessionRestored;
index f431eb766fe0e90c09dfc98d426c3b510017b338..80cf9858358fad4c835a49b834ace859677b9f0c 100755 (executable)
@@ -48,7 +48,6 @@ WebEngineService::WebEngineService()
     m_stateStruct->mostRecentTab.clear();
     m_stateStruct->tabs.clear();
 
-#if PROFILE_MOBILE
     // init settings
     m_settings[WebEngineSettings::PAGE_OVERVIEW] = boost::any_cast<bool>(tizen_browser::config::Config::getInstance().get(CONFIG_KEY::WEB_ENGINE_PAGE_OVERVIEW));
     m_settings[WebEngineSettings::LOAD_IMAGES] = boost::any_cast<bool>(tizen_browser::config::Config::getInstance().get(CONFIG_KEY::WEB_ENGINE_LOAD_IMAGES));
@@ -57,7 +56,6 @@ WebEngineService::WebEngineService()
     m_settings[WebEngineSettings::REMEMBER_PASSWORDS] = boost::any_cast<bool>(tizen_browser::config::Config::getInstance().get(CONFIG_KEY::WEB_ENGINE_REMEMBER_PASSWORDS));
     m_settings[WebEngineSettings::AUTOFILL_PROFILE_DATA] = boost::any_cast<bool>(tizen_browser::config::Config::getInstance().get(CONFIG_KEY::WEB_ENGINE_AUTOFILL_PROFILE_DATA));
     m_settings[WebEngineSettings::SCRIPTS_CAN_OPEN_PAGES] = boost::any_cast<bool>(tizen_browser::config::Config::getInstance().get(CONFIG_KEY::WEB_ENGINE_SCRIPTS_CAN_OPEN_PAGES));
-#endif
 }
 
 WebEngineService::~WebEngineService()
@@ -150,11 +148,10 @@ void WebEngineService::connectSignals(std::shared_ptr<WebView> webView)
 #if PWA
     webView->iconDownload.connect(boost::bind(&WebEngineService::_iconDownload, this, _1));
 #endif
-#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));
-#endif
 }
 
 void WebEngineService::disconnectSignals(std::shared_ptr<WebView> webView)
@@ -178,11 +175,10 @@ void WebEngineService::disconnectSignals(std::shared_ptr<WebView> webView)
 #if PWA
     webView->iconDownload.disconnect(boost::bind(&WebEngineService::_iconDownload, this));
 #endif
-#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));
-#endif
 }
 
 void WebEngineService::disconnectCurrentWebViewSignals()
@@ -310,9 +306,7 @@ void WebEngineService::suspend()
         return;
     }
     m_currentWebView->suspend();
-#if PROFILE_MOBILE
-        unregisterHWKeyCallback();
-#endif
+    unregisterHWKeyCallback();
 }
 
 void WebEngineService::resume()
@@ -324,9 +318,7 @@ void WebEngineService::resume()
         return;
     }
     m_currentWebView->resume();
-#if PROFILE_MOBILE
-        registerHWKeyCallback();
-#endif
+    registerHWKeyCallback();
 }
 
 bool WebEngineService::isSuspended() const
@@ -374,9 +366,7 @@ void WebEngineService::back(void)
     }
     m_stopped = false;
     m_currentWebView->back();
-#if PROFILE_MOBILE
     closeFindOnPage();
-#endif
 }
 
 void WebEngineService::forward(void)
@@ -389,9 +379,7 @@ void WebEngineService::forward(void)
     }
     m_stopped = false;
     m_currentWebView->forward();
-#if PROFILE_MOBILE
     closeFindOnPage();
-#endif
 }
 
 bool WebEngineService::isBackEnabled() const
@@ -547,9 +535,7 @@ TabId WebEngineService::addTab(
 
     m_stateStruct->tabs[newTabId] = p;
 
-#if PROFILE_MOBILE
     setWebViewSettings(p);
-#endif
 
     if (!uri.empty()) {
         p->setURI(uri);
@@ -582,9 +568,8 @@ bool WebEngineService::switchToTab(tizen_browser::basic_webengine::TabId newTabI
         BROWSER_LOGW("[%s:%d] there is no tab of id %d", __PRETTY_FUNCTION__, __LINE__, newTabId.get());
         return false;
     }
-#if PROFILE_MOBILE
     closeFindOnPage();
-#endif
+
     m_currentWebView = m_stateStruct->tabs[newTabId];
     m_currentTabId = newTabId;
     m_stateStruct->mostRecentTab.erase(
@@ -602,9 +587,7 @@ bool WebEngineService::switchToTab(tizen_browser::basic_webengine::TabId newTabI
     forwardEnableChanged(m_currentWebView->isForwardEnabled());
     backwardEnableChanged(m_currentWebView->isBackEnabled());
     currentTabChanged(m_currentTabId);
-#if PROFILE_MOBILE
     m_currentWebView->orientationChanged();
-#endif
 
     return true;
 }
@@ -731,7 +714,6 @@ std::shared_ptr<tizen_browser::tools::BrowserImage> WebEngineService::getFavicon
         return std::make_shared<tizen_browser::tools::BrowserImage>();
 }
 
-#if PROFILE_MOBILE
 void WebEngineService::setWebViewSettings(std::shared_ptr<WebView> webView) {
     webView->ewkSettingsAutoFittingSet(m_settings[WebEngineSettings::PAGE_OVERVIEW]);
     webView->ewkSettingsLoadsImagesSet(m_settings[WebEngineSettings::LOAD_IMAGES]);
@@ -757,7 +739,6 @@ void WebEngineService::_findOnPage(const std::string& str)
 {
     openFindOnPage(str);
 }
-#endif
 
 int WebEngineService::getZoomFactor() const
 {
@@ -863,7 +844,6 @@ void WebEngineService::_setWrongCertificatePem(const std::string& uri, const std
     setWrongCertificatePem(uri, pem);
 }
 
-#if PROFILE_MOBILE
 void WebEngineService::_download_request_cb(const char *download_uri, void *data)
 {
      BROWSER_LOGD("[%s:%d] download_uri= [%s]", __PRETTY_FUNCTION__, __LINE__, download_uri);
@@ -918,7 +898,6 @@ void WebEngineService::moreKeyPressed()
         m_currentWebView->exitFullScreen();
     }
 }
-#endif
 
 void WebEngineService::backButtonClicked()
 {
@@ -929,7 +908,6 @@ void WebEngineService::backButtonClicked()
         return;
     }
 
-#if PROFILE_MOBILE
     if (m_currentWebView->clearTextSelection())
         return;
 
@@ -937,7 +915,6 @@ void WebEngineService::backButtonClicked()
         m_currentWebView->exitFullScreen();
         return;
     }
-#endif
 
     if (isBackEnabled()) {
         m_currentWebView->back();
index 30a3e2d3a7211dd1f0c9e20b8624da11b0a6d7a9..1ff8eab42788a8bf3ec4ccb2698b347b100df846 100644 (file)
@@ -181,10 +181,8 @@ public:
      */
     void backButtonClicked();
 
-#if PROFILE_MOBILE
     void moreKeyPressed();
     void orientationChanged();
-#endif
 
     void switchToMobileMode();
     void switchToDesktopMode();
@@ -249,13 +247,12 @@ private:
 #if PWA
     void _iconDownload(std::string download_uri);
 #endif
-#if PROFILE_MOBILE
+
     int _getRotation();
     void setWebViewSettings(std::shared_ptr<WebView> webView);
     void _unsecureConnection();
     void _findOnPage(const std::string& str);
     static void _download_request_cb(const char *download_uri, void *data);
-#endif
 
     /**
      * disconnect signals from specified WebView
index 862c85c7b6438ba57acbfb3355640f84dcc27765..777c3bb4481a6e2d50f86f37e0f19d23cc4b961e 100755 (executable)
 #include <shortcut_manager.h>
 #include <string>
 
-#if PROFILE_MOBILE
 #include <device/haptic.h>
 #include <Ecore.h>
-#endif
 
 #define certificate_crt_path CERTS_DIR
 #define APPLICATION_NAME_FOR_USER_AGENT "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.69 safari/537.36 "
 //TODO: temporary user agent for mobile display, change to proper one
 #define APPLICATION_NAME_FOR_USER_AGENT_MOBILE "Mozilla/5.0 (Linux; Tizen 3.0; SAMSUNG TM1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/1.0 Chrome/47.0.2526.69 Mobile safari/537.36"
 
-#if PROFILE_MOBILE
 Ecore_Timer* m_haptic_timer_id =NULL;
 haptic_device_h m_haptic_handle;
 haptic_effect_h m_haptic_effect;
 
 #define FIND_WORD_MAX_COUNT 1000
-#endif
 
 using namespace tizen_browser::tools;
 
@@ -94,9 +90,7 @@ WebView::WebView(Evas_Object * obj, TabId tabId, const std::string& title, bool
     , m_suspended(false)
     , m_private(incognitoMode)
     , m_fullscreen(false)
-#if PROFILE_MOBILE
     , m_downloadControl(nullptr)
-#endif
 {
 }
 
@@ -108,9 +102,7 @@ WebView::~WebView()
         unregisterCallbacks();
         evas_object_del(m_ewkView);
     }
-#if PROFILE_MOBILE
     delete m_downloadControl;
-#endif
 }
 
 void WebView::init(bool desktopMode, TabOrigin origin)
@@ -142,14 +134,11 @@ void WebView::init(bool desktopMode, TabOrigin origin)
 
     setupEwkSettings();
     registerCallbacks();
-#if PROFILE_MOBILE
     m_downloadControl = new DownloadControl();
     orientationChanged();
-#endif
     resume();
 }
 
-#if PROFILE_MOBILE
 void WebView::orientationChanged()
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -210,7 +199,6 @@ void __vibration_cancel_cb(void * /*data*/)
 
     cancel_vibration();
 }
-#endif
 
 void WebView::registerCallbacks()
 {
@@ -227,10 +215,10 @@ void WebView::registerCallbacks()
 
     evas_object_smart_callback_add(m_ewkView, "create,window", __newWindowRequest, this);
     evas_object_smart_callback_add(m_ewkView, "close,window", __closeWindowRequest, this);
-#if PROFILE_MOBILE
+
     evas_object_smart_callback_add(m_ewkView, "policy,response,decide", __policy_response_decide_cb, this);
     evas_object_smart_callback_add(m_ewkView, "policy,navigation,decide", __policy_navigation_decide_cb, this);
-#endif
+
     evas_object_smart_callback_add(m_ewkView, "request,certificate,confirm", __requestCertificationConfirm, this);
     evas_object_smart_callback_add(m_ewkView, "ssl,certificate,changed", __setCertificatePem, this);
 
@@ -242,14 +230,13 @@ void WebView::registerCallbacks()
     evas_object_smart_callback_add(m_ewkView, "load,provisional,started", __load_provisional_started, this);
     evas_object_smart_callback_add(m_ewkView, "load,provisional,redirect", __load_provisional_redirect, this);
 
-#if PROFILE_MOBILE
     evas_object_smart_callback_add(m_ewkView, "contextmenu,customize", __contextmenu_customize_cb, this);
     evas_object_smart_callback_add(m_ewkView, "contextmenu,selected", __contextmenu_selected_cb, this);
     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);
-#endif
 
+    evas_object_smart_callback_add(m_ewkView, "rotate,prepared", __rotate_prepared_cb, this);
 }
 
 void WebView::unregisterCallbacks()
@@ -267,10 +254,10 @@ void WebView::unregisterCallbacks()
 
     evas_object_smart_callback_del_full(m_ewkView, "create,window", __newWindowRequest, this);
     evas_object_smart_callback_del_full(m_ewkView, "close,window", __closeWindowRequest, this);
-#if PROFILE_MOBILE
+
     evas_object_smart_callback_del_full(m_ewkView, "policy,response,decide", __policy_response_decide_cb, this);
     evas_object_smart_callback_del_full(m_ewkView, "policy,navigation,decide", __policy_navigation_decide_cb, this);
-#endif
+
     evas_object_smart_callback_del_full(m_ewkView, "request,certificate,confirm", __requestCertificationConfirm, this);
 
     evas_object_smart_callback_del_full(m_ewkView, "icon,received", __faviconChanged, this);
@@ -281,13 +268,13 @@ void WebView::unregisterCallbacks()
     evas_object_smart_callback_del_full(m_ewkView, "load,provisional,started", __load_provisional_started, this);
     evas_object_smart_callback_del_full(m_ewkView, "load,provisional,redirect", __load_provisional_redirect, this);
 
-#if PROFILE_MOBILE
     evas_object_smart_callback_del_full(m_ewkView, "contextmenu,customize", __contextmenu_customize_cb,this);
     evas_object_smart_callback_del_full(m_ewkView, "contextmenu,selected", __contextmenu_selected_cb, this);
     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);
-#endif
+
+    evas_object_smart_callback_del_full(m_ewkView, "rotate,prepared", __rotate_prepared_cb, this);
 }
 
 void WebView::setupEwkSettings()
@@ -349,7 +336,6 @@ std::map<std::string, std::vector<std::string> > WebView::parse_uri(const char *
     return uri_parts;
 }
 
-#if PROFILE_MOBILE
 Eina_Bool WebView::handle_scheme(const char *uri)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -643,7 +629,6 @@ Eina_Bool WebView::launch_tizenstore(const char *uri)
 
     return EINA_TRUE;
 }
-#endif
 
 Evas_Object * WebView::getLayout()
 {
@@ -1197,7 +1182,6 @@ void WebView::__setCertificatePem(void* data , Evas_Object* /* obj */, void* eve
     }
 }
 
-#if PROFILE_MOBILE
 context_menu_type WebView::_get_menu_type(Ewk_Context_Menu *menu)
 {
     int count = ewk_context_menu_item_count(menu);
@@ -1520,7 +1504,17 @@ void WebView::__fullscreen_exit_cb(void *data, Evas_Object*, void*)
     self->m_fullscreen = false;
     self->fullscreenModeSet(self->m_fullscreen);
 }
-#endif
+
+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__);
+    }
+}
 
 void WebView::setFocus()
 {
@@ -1561,7 +1555,6 @@ void WebView::scrollView(const int& dx, const int& dy)
     ewk_view_scroll_by(m_ewkView, dx, dy);
 }
 
-#if PROFILE_MOBILE
 void WebView::findWord(const char *word, Eina_Bool forward, Evas_Smart_Cb found_cb, void *data)
 {
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
@@ -1637,13 +1630,11 @@ void WebView::ewkSettingsFormProfileDataEnabledSet(bool value)
     Ewk_Settings* settings = ewk_view_settings_get(m_ewkView);
     ewk_settings_form_profile_data_enabled_set(settings, value);
 }
-#endif
 
 const TabId& WebView::getTabId() {
     return m_tabId;
 }
 
-
 tools::BrowserImagePtr WebView::getFavicon()
 {
     BROWSER_LOGD("%s:%d, TabId: %s", __PRETTY_FUNCTION__, __LINE__, m_tabId.toString().c_str());
@@ -1722,7 +1713,6 @@ void WebView::switchToMobileMode() {
 bool WebView::isDesktopMode() const {
     return m_desktopMode;
 }
-#if PROFILE_MOBILE
 
 void WebView::__policy_response_decide_cb(void *data, Evas_Object * /* obj */, void *event_info)
 {
@@ -1817,7 +1807,6 @@ void WebView::__policy_navigation_decide_cb(void *data, Evas_Object * /*obj*/, v
     }
     ewk_policy_decision_use(policy_decision);
 }
-#endif
 
 } /* namespace webengine_service */
 } /* end of basic_webengine */
index dd26e8828530849ac6d1d391f3203d71758b4f9c..d23346eacef9b7dcd766ae170bb628c21bb69fa3 100644 (file)
 #include "AbstractWebEngine/WebConfirmation.h"
 #include "AbstractWebEngine/TabOrigin.h"
 
-#if PROFILE_MOBILE
 #include "DownloadControl/DownloadControl.h"
 #include <app_control.h>
 #include <app.h>
 #include "AbstractRotatable.h"
-#endif
 
-#if PROFILE_MOBILE
 typedef enum _context_menu_type {
     TEXT_ONLY = 0,
     INPUT_FIELD,
@@ -62,25 +59,20 @@ typedef enum _custom_context_menu_item_tag {
     CUSTOM_CONTEXT_MENU_ITEM_SEND_EMAIL,
     CUSTOM_CONTEXT_MENU_ITEM_SEND_ADD_TO_CONTACT,
 } custom_context_menu_item_tag;
-#endif
 
 namespace tizen_browser {
 namespace basic_webengine {
 namespace webengine_service {
 
 class WebView
-#if PROFILE_MOBILE
         : public tizen_browser::interfaces::AbstractRotatable
-#endif
 {
 public:
     WebView(Evas_Object *, TabId, const std::string& title, bool incognitoMode);
     virtual ~WebView();
     void init(bool desktopMode, TabOrigin origin);
 
-#if PROFILE_MOBILE
     virtual void orientationChanged() override;
-#endif
 
     void setURI(const std::string &);
     std::string getURI(void);
@@ -196,7 +188,6 @@ public:
 
     TabOrigin getOrigin() { return m_origin; }
 
-#if PROFILE_MOBILE
     /**
      * @brief Searches for word in the current page.
      *
@@ -256,7 +247,6 @@ public:
      * @brief Set autofill profile data enabled settings flag.
      */
     void ewkSettingsFormProfileDataEnabledSet(bool value);
-#endif
 
 // signals
     boost::signals2::signal<void (std::shared_ptr<tizen_browser::tools::BrowserImage>)> favIconChanged;
@@ -282,6 +272,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;
@@ -306,7 +298,6 @@ private:
     static int result_cb(int ret, void *data);
 #endif
 
-#if  PROFILE_MOBILE
     context_menu_type _get_menu_type(Ewk_Context_Menu *menu);
     void _customize_context_menu(Ewk_Context_Menu *menu);
     void _show_context_menu_text_link(Ewk_Context_Menu *menu);
@@ -321,6 +312,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);
@@ -328,7 +320,6 @@ private:
     Eina_Bool launch_dialer(const char *uri);
     Eina_Bool launch_message(const char *uri);
     Eina_Bool launch_tizenstore(const char *uri);
-#endif
 
     // Load
     static void __loadStarted(void * data, Evas_Object * obj, void * event_info);
@@ -358,11 +349,9 @@ private:
 
     static void scriptLinkSearchCallback(Evas_Object *o, const char *value, void *data);
 
-#if PROFILE_MOBILE
     // downloads
     static void __policy_response_decide_cb(void *data, Evas_Object *obj, void *event_info);
     static void __policy_navigation_decide_cb(void *data, Evas_Object *obj, void *event_info);
-#endif
 
     // Screenshot capture
     static void __screenshotCaptured(Evas_Object* image, void* user_data);
@@ -393,11 +382,9 @@ private:
     static std::string m_pwaData;
 #endif
 
-#if PROFILE_MOBILE
     int m_status_code;
     Eina_Bool m_is_error_page;
     DownloadControl *m_downloadControl;
-#endif
 };
 
 } /* namespace webengine_service */
index 592995a8265c1e7b38683e27b52749423713bc33..d0e64067d8f0353d309a9df7881f2f664300b42a 100755 (executable)
@@ -221,6 +221,7 @@ void WebPageUI::setMainContent(Evas_Object* content)
     elm_gesture_layer_attach(m_gestureLayer, content);
 #endif
     evas_object_smart_callback_add(content, "mouse,down", _content_clicked, this);
+    updateManualRotation();
     evas_object_show(content);
 }
 
index 972b53fff86a1e668ddb8918bb502a0a40856087..c64840638b6e05180597abc75744fd5a8d43fa66 100755 (executable)
@@ -133,6 +133,7 @@ public:
     boost::signals2::signal<void ()> backPage;
     boost::signals2::signal<void ()> forwardPage;
     boost::signals2::signal<void ()> showTabUI;
+    boost::signals2::signal<void ()> updateManualRotation;
     boost::signals2::signal<void ()> showBookmarksUI;
     boost::signals2::signal<void ()> showHomePage;
     boost::signals2::signal<void ()> qaOrientationChanged;