summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorm.kawonczyk <m.kawonczyk@samsung.com>2016-09-29 15:04:23 +0200
committerHyeKyoung Hwang <cookie@samsung.com>2016-10-28 11:12:09 +0900
commitce41a8ba10b0ccfddd1e6fd53bf1168977ab5308 (patch)
tree54c85a80ce410ebfc5631d1c7e01abc19efba7c4
parent03c445295cf41fc8d8d2175266d6f10fe194c133 (diff)
downloadbrowser-ce41a8ba10b0ccfddd1e6fd53bf1168977ab5308.tar.gz
browser-ce41a8ba10b0ccfddd1e6fd53bf1168977ab5308.tar.bz2
browser-ce41a8ba10b0ccfddd1e6fd53bf1168977ab5308.zip
White patch is displayed while rotating device
[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
-rwxr-xr-xCMakeLists.txt11
-rw-r--r--core/AbstractWebEngine/AbstractWebEngine.h5
-rw-r--r--services/SimpleUI/SimpleUI.cpp126
-rw-r--r--services/SimpleUI/SimpleUI.h7
-rwxr-xr-xservices/WebEngineService/WebEngineService.cpp2
-rwxr-xr-xservices/WebEngineService/WebView.cpp15
-rw-r--r--services/WebEngineService/WebView.h3
-rwxr-xr-xservices/WebPageUI/WebPageUI.cpp1
-rw-r--r--services/WebPageUI/WebPageUI.h1
9 files changed, 131 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c03f0a1e..a56ceb13 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/core/AbstractWebEngine/AbstractWebEngine.h b/core/AbstractWebEngine/AbstractWebEngine.h
index 710f84b9..e33c85b7 100644
--- a/core/AbstractWebEngine/AbstractWebEngine.h
+++ b/core/AbstractWebEngine/AbstractWebEngine.h
@@ -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;
diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp
index 67869715..4e457d53 100644
--- a/services/SimpleUI/SimpleUI.cpp
+++ b/services/SimpleUI/SimpleUI.cpp
@@ -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)
diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h
index 7db34819..276832a7 100644
--- a/services/SimpleUI/SimpleUI.h
+++ b/services/SimpleUI/SimpleUI.h
@@ -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
diff --git a/services/WebEngineService/WebEngineService.cpp b/services/WebEngineService/WebEngineService.cpp
index ffe9aa10..9eeb1b66 100755
--- a/services/WebEngineService/WebEngineService.cpp
+++ b/services/WebEngineService/WebEngineService.cpp
@@ -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();
diff --git a/services/WebEngineService/WebView.cpp b/services/WebEngineService/WebView.cpp
index b2beb90e..5e07c4db 100755
--- a/services/WebEngineService/WebView.cpp
+++ b/services/WebEngineService/WebView.cpp
@@ -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
}
@@ -1439,6 +1443,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()
diff --git a/services/WebEngineService/WebView.h b/services/WebEngineService/WebView.h
index aaa99a72..97e07506 100644
--- a/services/WebEngineService/WebView.h
+++ b/services/WebEngineService/WebView.h
@@ -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);
diff --git a/services/WebPageUI/WebPageUI.cpp b/services/WebPageUI/WebPageUI.cpp
index efb210cb..953dc6f3 100755
--- a/services/WebPageUI/WebPageUI.cpp
+++ b/services/WebPageUI/WebPageUI.cpp
@@ -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);
}
diff --git a/services/WebPageUI/WebPageUI.h b/services/WebPageUI/WebPageUI.h
index 9080fba5..d11e9180 100644
--- a/services/WebPageUI/WebPageUI.h
+++ b/services/WebPageUI/WebPageUI.h
@@ -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