#include "net_connection.h"
#include "DownloadControl/DownloadControl.h"
-namespace tizen_browser{
-namespace base_ui{
+namespace tizen_browser {
+namespace base_ui {
using namespace config;
const int SCALE_FACTOR = 720;
const std::string SimpleUI::TAB_LIMIT_DECISION = "tab_limit_decision";
-SimpleUI::SimpleUI()
+SimpleUI::SimpleUI()
: AbstractMainWindow()
, m_webPageUI()
, m_bookmarkFlowUI()
, m_current_angle(0)
, m_temp_angle(0)
, m_alreadyOpenedExecURL(false)
- , m_languageChanged(false)
+ , m_languageChanged(false)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
elm_init(0, nullptr);
int width;
elm_win_screen_size_get(m_main_window, nullptr, nullptr, &width, nullptr);
- double config_scale_value = (double)(width)/SCALE_FACTOR;
- Config::getInstance().set(
- "scale", static_cast<double>(elm_config_scale_get()/config_scale_value));
+ double config_scale_value = (double) (width) / SCALE_FACTOR;
+ Config::getInstance().set("scale", static_cast<double>(elm_config_scale_get() / config_scale_value));
m_tabLimit = boost::any_cast<int>(Config::getInstance().get("TAB_LIMIT"));
m_qaLimit = boost::any_cast<int>(Config::getInstance().get("QUICKACCESS_LIMIT"));
if (elm_win_wm_rotation_supported_get(m_main_window)) {
rotationType(rotationLock::noLock);
- evas_object_smart_callback_add(m_main_window, "wm,rotation,changed", __orientation_changed, this);
+ evas_object_smart_callback_add(m_main_window, "wm,rotation,changed",
+ __orientation_changed, this);
enableManualRotation(false);
- } else
+ } else {
BROWSER_LOGW("[%s:%d] Device does not support rotation.", __PRETTY_FUNCTION__, __LINE__);
+ }
// TODO Unify the virtual keyboard behavior. For now webview entry and url entry have the separate ways to
// 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);
+ 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);
m_splash_screen.init(m_main_window);
- m_splash_screen.isLandscape.connect([this]{ return isLandscape(); });
+ m_splash_screen.isLandscape.connect([this] {return isLandscape();});
m_splash_screen.updateManualRotation.connect(
- [this]{ enableManualRotation(isManualRotation(m_viewManager.topOfStack())); });
+ [this] {enableManualRotation(isManualRotation(m_viewManager.topOfStack()));});
}
-void SimpleUI::resume()
-{
+void SimpleUI::resume() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_functionViewPrepare();
if (!m_pwa.isActive() && m_webPageUI->stateEquals(WPUState::QUICK_ACCESS))
m_webEngine->setFocus();
#if DUMMY_BUTTON
else
- m_webPageUI->createDummyButton();
+ m_webPageUI->createDummyButton();
#endif
- if (m_pwa.isActive() ||
- m_webPageUI->stateEquals(WPUState::MAIN_INCOGNITO_PAGE) ||
- m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE))
+ if (m_pwa.isActive()
+ || m_webPageUI->stateEquals(WPUState::MAIN_INCOGNITO_PAGE)
+ || m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE))
m_webEngine->resume();
if (m_languageChanged) {
m_languageChanged = false;
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
}
-void SimpleUI::prepareServices()
-{
+void SimpleUI::prepareServices() {
loadUIServices();
loadModelServices();
- auto futureModelSig =
- std::async(std::launch::async, [this]{ connectModelSignals(); });
- auto futureUISig
- = std::async(std::launch::async, [this]{ connectUISignals(); });
+ auto futureModelSig = std::async(std::launch::async,
+ [this] {connectModelSignals();});
+ auto futureUISig = std::async(std::launch::async,
+ [this] {connectUISignals();});
futureModelSig.get();
futureUISig.get();
initModelServices();
}
-void SimpleUI::preparePWAServices()
-{
+void SimpleUI::preparePWAServices() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- m_webPageMin =
- std::dynamic_pointer_cast<base_ui::WebPageMin, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.webpagemin", "libWebPageMin.so"));
+ m_webPageMin = std::dynamic_pointer_cast<base_ui::WebPageMin,
+ core::AbstractService>(
+ core::ServiceManager::getInstance().getService(
+ "org.tizen.browser.webpagemin",
+ "libWebPageMin.so"));
- m_webEngine =
- std::dynamic_pointer_cast
- <basic_webengine::AbstractWebEngine, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.webenginemin", "libWebEngineMin.so"));
+ m_webEngine = std::dynamic_pointer_cast<basic_webengine::AbstractWebEngine,
+ core::AbstractService>(
+ core::ServiceManager::getInstance().getService(
+ "org.tizen.browser.webenginemin",
+ "libWebEngineMin.so"));
- m_platformInputManager =
- std::dynamic_pointer_cast
- <services::PlatformInputManager, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.platforminputmanager", "libPlatformInputManager.so"));
+ m_platformInputManager = std::dynamic_pointer_cast<
+ services::PlatformInputManager, core::AbstractService>(
+ core::ServiceManager::getInstance().getService(
+ "org.tizen.browser.platforminputmanager",
+ "libPlatformInputManager.so"));
- m_storageService = std::dynamic_pointer_cast
- <services::StorageService, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.storageservice", "libStorageService.so"));
+ m_storageService = std::dynamic_pointer_cast<services::StorageService,
+ core::AbstractService>(
+ core::ServiceManager::getInstance().getService(
+ "org.tizen.browser.storageservice",
+ "libStorageService.so"));
connectPWASignals();
m_webEngine->init(m_webPageMin->getContent());
}
-int SimpleUI::exec(const std::string& url, const std::string& caller, const std::string& operation)
-{
- BROWSER_LOGD(
- "[%s] url=%s, caller=%s, operation=%s, initialised=%d",
- __func__,
- url.c_str(),
- caller.c_str(),
- operation.c_str(),
- m_initialised);
+int SimpleUI::exec(const std::string& url, const std::string& caller,
+ const std::string& operation) {
+ BROWSER_LOGD("[%s] url=%s, caller=%s, operation=%s, initialised=%d",
+ __func__, url.c_str(), caller.c_str(), operation.c_str(),
+ m_initialised);
std::string pwaUrl = m_pwa.preparePWA(url);
if (m_pwa.isActive()) {
- if (m_pwa.getPWAinfo().orientation == WebPageUI::WebScreenOrientationLockPortrait)
+ if (m_pwa.getPWAinfo().orientation
+ == WebPageUI::WebScreenOrientationLockPortrait)
rotationType(rotationLock::portrait);
- else if (m_pwa.getPWAinfo().orientation == WebPageUI::WebScreenOrientationLockLandscape)
+ else if (m_pwa.getPWAinfo().orientation
+ == WebPageUI::WebScreenOrientationLockLandscape)
rotationType(rotationLock::landscape);
}
if (!m_initialised)
m_alreadyOpenedExecURL = false;
m_functionViewPrepare = [=]() mutable {
if (!m_initialised) {
- if (m_pwa.isActive()) { // Progressive web app
- preparePWAServices();
- pushViewToStack(m_webPageMin);
- m_platformInputManager->registerHWKeyCallback(m_viewManager.getContent());
- } else {
+ if (m_pwa.isActive()) { // Progressive web app
+ preparePWAServices();
+ pushViewToStack(m_webPageMin);
+ m_platformInputManager->registerHWKeyCallback(m_viewManager.getContent());
+ } else {
if (m_window.get()) {
- prepareServices();
-
- //Push first view to stack.
- pushViewToStack(m_webPageUI);
-
- // Register H/W back key callback
- m_platformInputManager->registerHWKeyCallback(m_viewManager.getContent());
+ prepareServices();
+ //Push first view to stack.
+ pushViewToStack(m_webPageUI);
+ // Register H/W back key callback
+ m_platformInputManager->registerHWKeyCallback(m_viewManager.getContent());
}
BROWSER_LOGD("[%s]: restore last session", __func__);
}
};
- if (!operation.compare(APP_CONTROL_OPERATION_VIEW) ||
- !operation.compare("libpush.operation.handle"))
+ if (!operation.compare(APP_CONTROL_OPERATION_VIEW)
+ || !operation.compare("libpush.operation.handle"))
resume();
BROWSER_LOGD("[%s]:%d url=%s", __func__, __LINE__, url.c_str());
return 0;
}
-void SimpleUI::countCheckUrl()
-{
+void SimpleUI::countCheckUrl() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- bool chk = m_storageService->getPWAStorage().getPWACheck(m_webEngine->getURI());
+ bool chk = m_storageService->getPWAStorage().getPWACheck(
+ m_webEngine->getURI());
if (!chk) {
int ret = m_historyService->getHistoryCnt(
- m_historyService->getHistoryId(m_webEngine->getURI()));
+ m_historyService->getHistoryId(m_webEngine->getURI()));
if (ret >= CONNECT_COUNT)
pwaPopupRequest();
}
}
-void SimpleUI::restoreLastSession()
-{
+void SimpleUI::restoreLastSession() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto vec(m_tabService->getAllTabs());
for (const auto& i : *vec) {
- openNewTab(
- i.getUrl(),
- i.getTitle(),
- boost::optional<int>(i.getId().get()),
- false,
- i.getOrigin());
+ openNewTab(i.getUrl(), i.getTitle(),
+ boost::optional<int>(i.getId().get()), false,
+ i.getOrigin());
}
}
-void SimpleUI::loadUIServices()
-{
+void SimpleUI::loadUIServices() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_webPageUI =
futureBookmarksMan.get();
}
-void SimpleUI::loadModelServices()
-{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
-
- m_webEngine =
- std::dynamic_pointer_cast
- <basic_webengine::AbstractWebEngine, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.webengineservice", "libWebEngineService.so"));
-
- m_historyService =
- std::dynamic_pointer_cast
- <services::HistoryService, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.historyservice", "libHistoryService.so"));
-
- m_platformInputManager =
- std::dynamic_pointer_cast
- <services::PlatformInputManager, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.platforminputmanager", "libPlatformInputManager.so"));
-
- auto futureStorage(std::async(std::launch::async, [this]{
- m_storageService = std::dynamic_pointer_cast
- <services::StorageService, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.storageservice", "libStorageService.so"));
- }));
- auto futureTab(std::async(std::launch::async, [this]{
- m_tabService = std::dynamic_pointer_cast<
- services::TabService, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.tabservice", "libTabService.so"));
- }));
- auto futureFavourite(std::async(std::launch::async, [this]{
- m_favoriteService = std::dynamic_pointer_cast
- <services::BookmarkService, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.favoriteservice", "libBookmarkService.so"));
- }));
- auto futureCertificates(std::async(std::launch::async, [this]{
- m_certificateContents = std::dynamic_pointer_cast
- <services::CertificateContents, core::AbstractService>(
- core::ServiceManager::getInstance().getService("org.tizen.browser.certificateservice", "libCertificateService.so"));
- }));
+void SimpleUI::loadModelServices() {
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+
+ m_webEngine = std::dynamic_pointer_cast<basic_webengine::AbstractWebEngine,
+ core::AbstractService>(
+ core::ServiceManager::getInstance().getService(
+ "org.tizen.browser.webengineservice",
+ "libWebEngineService.so"));
+
+ m_historyService = std::dynamic_pointer_cast<services::HistoryService,
+ core::AbstractService>(
+ core::ServiceManager::getInstance().getService(
+ "org.tizen.browser.historyservice",
+ "libHistoryService.so"));
+
+ m_platformInputManager = std::dynamic_pointer_cast<
+ services::PlatformInputManager, core::AbstractService>(
+ core::ServiceManager::getInstance().getService(
+ "org.tizen.browser.platforminputmanager",
+ "libPlatformInputManager.so"));
+
+ auto futureStorage(
+ std::async(std::launch::async,
+ [this] {
+ m_storageService = std::dynamic_pointer_cast
+ <services::StorageService, core::AbstractService>(
+ core::ServiceManager::getInstance().getService("org.tizen.browser.storageservice", "libStorageService.so"));
+ }));
+ auto futureTab(
+ std::async(std::launch::async,
+ [this] {
+ m_tabService = std::dynamic_pointer_cast<
+ services::TabService, core::AbstractService>(
+ core::ServiceManager::getInstance().getService("org.tizen.browser.tabservice", "libTabService.so"));
+ }));
+ auto futureFavourite(
+ std::async(std::launch::async,
+ [this] {
+ m_favoriteService = std::dynamic_pointer_cast
+ <services::BookmarkService, core::AbstractService>(
+ core::ServiceManager::getInstance().getService("org.tizen.browser.favoriteservice", "libBookmarkService.so"));
+ }));
+ auto futureCertificates(
+ std::async(std::launch::async,
+ [this] {
+ m_certificateContents = std::dynamic_pointer_cast
+ <services::CertificateContents, core::AbstractService>(
+ core::ServiceManager::getInstance().getService("org.tizen.browser.certificateservice", "libCertificateService.so"));
+ }));
futureStorage.get();
futureTab.get();
futureFavourite.get();
futureCertificates.get();
}
-void SimpleUI::connectWebPageSignals()
-{
+void SimpleUI::connectWebPageSignals() {
assert(m_webPageUI.get());
m_webPageUI->getURIEntry().uriChanged.connect(
- [this](const auto& url) { this->filterURL(url); });
- m_webPageUI->backPage.connect(
- [this]{ this->switchViewToWebPage(); });
- m_webPageUI->backPage.connect(
- [this]{ m_webEngine->back(); });
- m_webPageUI->showTabUI.connect(
- [this]{ this->showTabUI(); });
- m_webPageUI->showHomePage.connect(
- [this]{ this->showHomePage(); });
- m_webPageUI->forwardPage.connect(
- [this]{ m_webEngine->forward(); });
- m_webPageUI->showQuickAccess.connect(
- [this]{ m_quickAccess->showUI(); });
- m_webPageUI->hideQuickAccess.connect(
- [this]{ m_quickAccess->hideUI(); });
+ [this](const auto& url) {this->filterURL(url);});
+ m_webPageUI->backPage.connect([this] {this->switchViewToWebPage();});
+ m_webPageUI->backPage.connect([this] {m_webEngine->back();});
+ m_webPageUI->showTabUI.connect([this] {this->showTabUI();});
+ m_webPageUI->showHomePage.connect([this] {this->showHomePage();});
+ m_webPageUI->forwardPage.connect([this] {m_webEngine->forward();});
+ m_webPageUI->showQuickAccess.connect([this] {m_quickAccess->showUI();});
+ m_webPageUI->hideQuickAccess.connect([this] {m_quickAccess->hideUI();});
m_webPageUI->getQuickAccessEditUI()->requestQuickAccessEditLayout.connect(
- [this]{ return m_quickAccess->getQuickAccessEditLayout(); });
+ [this] {return m_quickAccess->getQuickAccessEditLayout();});
m_webPageUI->getQuickAccessEditUI()->requestMostVisitedEditLayout.connect(
- [this]{ return m_quickAccess->getMostVisitedEditLayout(); });
+ [this] {return m_quickAccess->getMostVisitedEditLayout();});
m_webPageUI->getQuickAccessEditUI()->requestQuickAccessState.connect(
- [this]{ return m_quickAccess->getQuickAccessState(); });
+ [this] {return m_quickAccess->getQuickAccessState();});
m_webPageUI->getQuickAccessEditUI()->editingFinished.connect(
- [this]{ m_quickAccess->editingFinished(); m_webPageUI->editingFinished(); });
+ [this] {m_quickAccess->editingFinished(); m_webPageUI->editingFinished();});
m_webPageUI->getQuickAccessEditUI()->deleteSelectedMostVisitedItems.connect(
- [this]{ m_quickAccess->deleteSelectedMostVisitedItems(); });
+ [this] {m_quickAccess->deleteSelectedMostVisitedItems();});
m_webPageUI->getQuickAccessEditUI()->reorderQuickAccessItems.connect(
- [this]{ m_quickAccess->reorderQuickAccessItems(); });
+ [this] {m_quickAccess->reorderQuickAccessItems();});
m_webPageUI->getQuickAccessEditUI()->closeUI.connect(
- [this]{ this->popTheStack(); });
- m_webPageUI->focusWebView.connect(
- [this]{ m_webEngine->setFocus(); });
- m_webPageUI->unfocusWebView.connect(
- [this]{ m_webEngine->clearFocus(); });
+ [this] {this->popTheStack();});
+ m_webPageUI->focusWebView.connect([this] {m_webEngine->setFocus();});
+ m_webPageUI->unfocusWebView.connect([this] {m_webEngine->clearFocus();});
m_webPageUI->showBookmarksUI.connect(
- [this]{ showBookmarkManagerUI(m_favoriteService->getRoot(), BookmarkManagerState::Default); });
+ [this] {showBookmarkManagerUI(m_favoriteService->getRoot(), BookmarkManagerState::Default);});
m_webPageUI->updateManualRotation.connect(
- [this]{ enableManualRotation(isManualRotation(m_viewManager.topOfStack())); });
- m_webPageUI->getWindow.connect(
- [this]{ return this->getMainWindow(); });
- m_webPageUI->isBookmark.connect(
- [this]{ return this->checkBookmark(); });
+ [this] {enableManualRotation(isManualRotation(m_viewManager.topOfStack()));});
+ m_webPageUI->getWindow.connect([this] {return this->getMainWindow();});
+ m_webPageUI->isBookmark.connect([this] {return this->checkBookmark();});
m_webPageUI->isQuickAccess.connect(
- [this]{ return m_storageService->getQuickAccessStorage().quickAccessItemExist(m_webEngine->getURI()); });
+ [this] {return m_storageService->getQuickAccessStorage().quickAccessItemExist(m_webEngine->getURI());});
m_webPageUI->getMostVisitedCount.connect(
- [this]{ return m_quickAccess->getMostVisitedItemsCount(); });
- m_webPageUI->deleteBookmark.connect(
- [this]{ this->deleteBookmark(); });
+ [this] {return m_quickAccess->getMostVisitedItemsCount();});
+ m_webPageUI->deleteBookmark.connect([this] {this->deleteBookmark();});
m_webPageUI->showBookmarkFlowUI.connect(
- [this]{ this->showBookmarkFlowUI(); });
+ [this] {this->showBookmarkFlowUI();});
m_webPageUI->showFindOnPageUI.connect(
- [this]{ this->showFindOnPageUI(std::string()); });
+ [this] {this->showFindOnPageUI(std::string());});
m_webPageUI->isFindOnPageVisible.connect(
- [this]{ return m_findOnPageUI->isVisible(); });
+ [this] {return m_findOnPageUI->isVisible();});
m_webPageUI->showSettingsUI.connect(
- [this]{ m_settingsManager->showSettingsBaseUI(); });
- m_webPageUI->addNewTab.connect(
- [this]{ this->newTabClicked(); });
+ [this] {m_settingsManager->showSettingsBaseUI();});
+ m_webPageUI->addNewTab.connect([this] {this->newTabClicked();});
m_webPageUI->getURIEntry().mobileEntryFocused.connect(
- [this]{ m_webPageUI->mobileEntryFocused(); });
+ [this] {m_webPageUI->mobileEntryFocused();});
m_webPageUI->getURIEntry().mobileEntryUnfocused.connect(
- [this]{ m_webPageUI->mobileEntryUnfocused(); });
+ [this] {m_webPageUI->mobileEntryUnfocused();});
m_webPageUI->qaOrientationChanged.connect(
- [this]{ m_quickAccess->orientationChanged(); });
+ [this] {m_quickAccess->orientationChanged();});
m_webPageUI->getURIEntry().secureIconClicked.connect(
- [this]{ this->showCertificatePopup(); });
+ [this] {this->showCertificatePopup();});
m_webPageUI->getURIEntry().isValidCert.connect(
- [this](const auto& url){ return m_certificateContents->isValidCertificate(url); });
+ [this](const auto& url) {return m_certificateContents->isValidCertificate(url);});
m_webPageUI->getURIEntry().reloadPage.connect(
- [this]{ m_webEngine->reload(); });
+ [this] {m_webEngine->reload();});
m_webPageUI->getURIEntry().stopLoadingPage.connect(
- [this]{ m_webEngine->stopLoading(); });
+ [this] {m_webEngine->stopLoading();});
m_webPageUI->getURIEntry().createSearchQuery.connect(
- [this](const std::string& s){ return this->createSearchQuery(s); });
- m_webPageUI->isLandscape.connect(
- [this]{ return this->isLandscape(); });
+ [this](const std::string& s) {return this->createSearchQuery(s);});
+ m_webPageUI->isLandscape.connect([this] {return this->isLandscape();});
m_webPageUI->switchToMobileMode.connect(
- [this]{ this->switchToMobileMode(); });
+ [this] {this->switchToMobileMode();});
m_webPageUI->switchToDesktopMode.connect(
- [this]{ this->switchToDesktopMode(); });
- m_webPageUI->quickAccessEdit.connect(
- [this]{ this->editQuickAccess(); });
- m_webPageUI->deleteMostVisited.connect(
- [this]{ this->deleteMostVisited(); });
+ [this] {this->switchToDesktopMode();});
+ m_webPageUI->quickAccessEdit.connect([this] {this->editQuickAccess();});
+ m_webPageUI->deleteMostVisited.connect([this] {this->deleteMostVisited();});
m_webPageUI->addToQuickAccess.connect(
- [this](const auto& url, const auto& title){ this->addQuickAccessItem(url, title); });
- m_webPageUI->getTitle.connect(
- [this]{ return m_webEngine->getTitle(); });
+ [this](const auto& url, const auto& title) {this->addQuickAccessItem(url, title);});
+ m_webPageUI->getTitle.connect([this] {return m_webEngine->getTitle();});
m_webPageUI->getEngineState.connect(
- [this]{ return m_webEngine->getState(); });
+ [this] {return m_webEngine->getState();});
m_webPageUI->requestCurrentPageForWebPageUI.connect(
- [this]{ return requestSettingsCurrentPage(); });
+ [this] {return requestSettingsCurrentPage();});
m_webPageUI->pwaRequestManifest.connect(
- [this]{ m_webEngine->setPWAData(); });
+ [this] {m_webEngine->setPWAData();});
m_webPageUI->getCountCheckSignal.connect(
- [this]{ return this->countCheckUrl(); });
+ [this] {return this->countCheckUrl();});
m_webPageUI->isMostVisited.connect(
- [this]{ return m_quickAccess->isMostVisitedActive(); });
+ [this] {return m_quickAccess->isMostVisitedActive();});
m_webPageUI->setBarsShown.connect(
- [this](bool value){ this->m_webEngine->setBarsShown(value); });
+ [this](bool value) {this->m_webEngine->setBarsShown(value);});
}
-void SimpleUI::connectQuickAccessSignals()
-{
+void SimpleUI::connectQuickAccessSignals() {
assert(m_quickAccess.get());
m_quickAccess->openURLquickaccess.connect(
- [this](const auto& item){ this->openURL(item->getUrl(), item->getTitle(), m_webEngine->isDesktopMode()); });
+ [this](const auto& item) {this->openURL(item->getUrl(), item->getTitle(), m_webEngine->isDesktopMode());});
m_quickAccess->openURLhistory.connect(
- [this](const auto& item){ this->openURL(item->getUrl(), item->getTitle(), m_webEngine->isDesktopMode()); });
+ [this](const auto& item) {this->openURL(item->getUrl(), item->getTitle(), m_webEngine->isDesktopMode());});
m_quickAccess->getMostVisitedItems.connect(
- [this]{ m_quickAccess->setMostVisitedItems(m_historyService->getMostVisitedHistoryItems()); });
+ [this] {m_quickAccess->setMostVisitedItems(m_historyService->getMostVisitedHistoryItems());});
m_quickAccess->getQuickAccessItems.connect(
- [this]{ m_quickAccess->setQuickAccessItems(m_storageService->getQuickAccessStorage().getQuickAccessList()); });
+ [this] {m_quickAccess->setQuickAccessItems(m_storageService->getQuickAccessStorage().getQuickAccessList());});
m_quickAccess->switchViewToWebPage.connect(
- [this]{ return this->switchViewToWebPage(); });
+ [this] {return this->switchViewToWebPage();});
m_quickAccess->addQuickAccessClicked.connect(
- [this]{ return this->onNewQuickAccessClicked(); });
+ [this] {return this->onNewQuickAccessClicked();});
m_quickAccess->deleteQuickAccessItem.connect(
- [this](const auto& item){ m_storageService->getQuickAccessStorage().deleteQuickAccessItem(item->getId()); });
+ [this](const auto& item) {m_storageService->getQuickAccessStorage().deleteQuickAccessItem(item->getId());});
m_quickAccess->reorderQuickAccessItem.connect(
- [this](const auto& item, const auto& order){ m_storageService->getQuickAccessStorage().updateItemOrder(item->getId(), order); });
+ [this](const auto& item, const auto& order) {m_storageService->getQuickAccessStorage().updateItemOrder(item->getId(), order);});
m_quickAccess->removeMostVisitedItem.connect(
- [this](const auto& item, const auto& freq){ m_historyService->setMostVisitedFrequency(item->getId(), freq); });
+ [this](const auto& item, const auto& freq) {m_historyService->setMostVisitedFrequency(item->getId(), freq);});
m_quickAccess->sendSelectedMVItemsCount.connect(
- [this](const auto& count){ m_webPageUI->setMostVisitedSelectedItemsCountInEditMode(count); });
- m_quickAccess->isLandscape.connect(
- [this]{ return this->isLandscape(); });
+ [this](const auto& count) {m_webPageUI->setMostVisitedSelectedItemsCountInEditMode(count);});
+ m_quickAccess->isLandscape.connect([this] {return this->isLandscape();});
}
-void SimpleUI::connectTabsSignals()
-{
+void SimpleUI::connectTabsSignals() {
assert(m_tabUI.get());
- m_tabUI->closeTabUIClicked.connect(
- [this]{ this->popTheStack(); });
- m_tabUI->newTabClicked.connect(
- [this]{ this->newTabClicked(); });
- m_tabUI->tabClicked.connect(
- [this](const auto& id){ this->tabClicked(id); });
+ m_tabUI->closeTabUIClicked.connect([this] {this->popTheStack();});
+ m_tabUI->newTabClicked.connect([this] {this->newTabClicked();});
+ m_tabUI->tabClicked.connect([this](const auto& id) {this->tabClicked(id);});
m_tabUI->closeTabsClicked.connect(
- [this](const auto& tabId){ m_webEngine->closeTab(tabId); });
- m_tabUI->getWindow.connect(
- [this]{ return this->getMainWindow(); });
- m_tabUI->isLandscape.connect(
- [this]{ return this->isLandscape(); });
- m_tabUI->changeEngineState.connect(
- [this]{ this->changeEngineState(); });
- m_tabUI->refetchTabUIData.connect(
- [this]{ this->refetchTabUIData(); });
+ [this](const auto& tabId) {m_webEngine->closeTab(tabId);});
+ m_tabUI->getWindow.connect([this] {return this->getMainWindow();});
+ m_tabUI->isLandscape.connect([this] {return this->isLandscape();});
+ m_tabUI->changeEngineState.connect([this] {this->changeEngineState();});
+ m_tabUI->refetchTabUIData.connect([this] {this->refetchTabUIData();});
m_tabUI->checkIfParamExistsInDB.connect(
- [this](const auto& key){ return m_storageService->getSettingsStorage().isDBParamPresent(key); });
+ [this](const auto& key) {return m_storageService->getSettingsStorage().isDBParamPresent(key);});
m_tabUI->setDBBoolParamValue.connect(
- [this](const auto& key, const auto& value){ m_storageService->getSettingsStorage().setSettingsBool(key, value); });
+ [this](const auto& key, const auto& value) {m_storageService->getSettingsStorage().setSettingsBool(key, value);});
m_tabUI->setDBStringParamValue.connect(
- [this](const auto& key, const auto& value){ m_storageService->getSettingsStorage().setSettingsString(key, value); });
+ [this](const auto& key, const auto& value) {m_storageService->getSettingsStorage().setSettingsString(key, value);});
m_tabUI->getDBBoolParamValue.connect(
- [this](const auto& key){ return m_storageService->getSettingsStorage().getSettingsBool(key, false); });
+ [this](const auto& key) {return m_storageService->getSettingsStorage().getSettingsBool(key, false);});
m_tabUI->getDBStringParamValue.connect(
- [this](const auto& key){ return m_storageService->getSettingsStorage().getSettingsText(key, ""); });
+ [this](const auto& key) {return m_storageService->getSettingsStorage().getSettingsText(key, "");});
m_tabUI->showPasswordUI.connect(
- [this]{ pushViewToStack(m_tabUI->getPasswordUI()); });
- m_tabUI->showNoPasswordWarning.connect(
- [this]{ this->onFirstSecretMode(); });
- m_tabUI->getPasswordUI()->closeUI.connect(
- [this]{ this->popTheStack(); });
+ [this] {pushViewToStack(m_tabUI->getPasswordUI());});
+ m_tabUI->showNoPasswordWarning.connect([this] {this->onFirstSecretMode();});
+ m_tabUI->getPasswordUI()->closeUI.connect([this] {this->popTheStack();});
m_tabUI->getPasswordUI()->setDBStringParamValue.connect(
- [this](const auto& key, const auto& value){ m_storageService->getSettingsStorage().setSettingsString(key, value); });
+ [this](const auto& key, const auto& value) {m_storageService->getSettingsStorage().setSettingsString(key, value);});
m_tabUI->getPasswordUI()->setDBBoolParamValue.connect(
- [this](const auto& key, const auto& value){ m_storageService->getSettingsStorage().setSettingsBool(key, value); });
+ [this](const auto& key, const auto& value) {m_storageService->getSettingsStorage().setSettingsBool(key, value);});
m_tabUI->getPasswordUI()->getDBStringParamValue.connect(
- [this](const auto& key){ return m_storageService->getSettingsStorage().getSettingsText(key, ""); });
+ [this](const auto& key) {return m_storageService->getSettingsStorage().getSettingsText(key, "");});
m_tabUI->getPasswordUI()->getDBBoolParamValue.connect(
- [this](const auto& key){ return m_storageService->getSettingsStorage().getSettingsBool(key, false); });
+ [this](const auto& key) {return m_storageService->getSettingsStorage().getSettingsBool(key, false);});
m_tabUI->getPasswordUI()->changeEngineState.connect(
- [this]{ this->changeEngineState(); });
+ [this] {this->changeEngineState();});
}
-void SimpleUI::connectHistorySignals()
-{
+void SimpleUI::connectHistorySignals() {
assert(m_historyUI.get());
m_historyUI->clearHistoryClicked.connect(
- [this]{ this->onClearHistoryAllClicked(); });
+ [this] {this->onClearHistoryAllClicked();});
m_historyUI->signalDeleteHistoryItems.connect(
- [this](const auto& id){ m_historyService->deleteHistoryItem(id); });
- m_historyUI->closeHistoryUIClicked.connect(
- [this]{ this->popTheStack(); });
+ [this](const auto& id) {m_historyService->deleteHistoryItem(id);});
+ m_historyUI->closeHistoryUIClicked.connect([this] {this->popTheStack();});
m_historyUI->signalHistoryItemClicked.connect(
- [this](const auto& url, const auto& title){ this->openURL(url, title, false); });
- m_historyUI->getWindow.connect(
- [this]{ return this->getMainWindow(); });
+ [this](const auto& url, const auto& title) {this->openURL(url, title, false);});
+ m_historyUI->getWindow.connect([this] {return this->getMainWindow();});
}
-void SimpleUI::connectBookmarkFlowSignals()
-{
+void SimpleUI::connectBookmarkFlowSignals() {
assert(m_bookmarkFlowUI.get());
m_bookmarkFlowUI->closeBookmarkFlowClicked.connect(
- [this]{ this->popTheStack(); });
+ [this] {this->popTheStack();});
m_bookmarkFlowUI->saveBookmark.connect(
- [this](const auto& bookmark_update){ this->addBookmark(bookmark_update); });
+ [this](const auto& bookmark_update) {this->addBookmark(bookmark_update);});
m_bookmarkFlowUI->editBookmark.connect(
- [this](const auto& bookmark_update){ this->editBookmark(bookmark_update); });
+ [this](const auto& bookmark_update) {this->editBookmark(bookmark_update);});
m_bookmarkFlowUI->showSelectFolderUI.connect(
- [this](const auto& parent){ this->showBookmarkManagerUI(parent, BookmarkManagerState::SelectFolder); });
+ [this](const auto& parent) {this->showBookmarkManagerUI(parent, BookmarkManagerState::SelectFolder);});
m_bookmarkFlowUI->addToQuickAccess.connect(
- [this](const auto& url, const auto& title){ this->addQuickAccessItem(url, title); });
+ [this](const auto& url, const auto& title) {this->addQuickAccessItem(url, title);});
}
-void SimpleUI::connectBookmarkManagerSignals()
-{
+void SimpleUI::connectBookmarkManagerSignals() {
assert(m_bookmarkManagerUI.get());
m_bookmarkManagerUI->closeBookmarkManagerClicked.connect(
- [this]{ this->popTheStack(); });
+ [this] {this->popTheStack();});
m_bookmarkManagerUI->folderSelected.connect(
- [this](const auto& item){ m_bookmarkFlowUI->setFolder(item); });
+ [this](const auto& item) {m_bookmarkFlowUI->setFolder(item);});
m_bookmarkManagerUI->getWindow.connect(
- [this]{ return this->getMainWindow(); });
+ [this] {return this->getMainWindow();});
m_bookmarkManagerUI->bookmarkItemClicked.connect(
- [this](const auto& item){ this->onBookmarkClicked(item); });
+ [this](const auto& item) {this->onBookmarkClicked(item);});
m_bookmarkManagerUI->bookmarkItemEdit.connect(
- [this](const auto& item){ this->onBookmarkEdit(item); });
+ [this](const auto& item) {this->onBookmarkEdit(item);});
m_bookmarkManagerUI->bookmarkItemOrderEdited.connect(
- [this](const auto& item){ m_favoriteService->editBookmark(item->getId(), "", "", -1, item->getOrder()); });
+ [this](const auto& item) {m_favoriteService->editBookmark(item->getId(), "", "", -1, item->getOrder());});
m_bookmarkManagerUI->bookmarkItemDeleted.connect(
- [this](const auto& item) { m_favoriteService->deleteBookmark(item->getId()); });
+ [this](const auto& item) {m_favoriteService->deleteBookmark(item->getId());});
m_bookmarkManagerUI->newFolderItemClicked.connect(
- [this](const auto& id){ this->onNewFolderClicked(id); });
+ [this](const auto& id) {this->onNewFolderClicked(id);});
m_bookmarkManagerUI->isLandscape.connect(
- [this]{ return this->isLandscape(); });
+ [this] {return this->isLandscape();});
m_bookmarkManagerUI->getHistoryGenlistContent.connect(
- [this](const auto& parent, const auto& navi, const auto& remove){ return this->showHistoryUI(parent, navi, remove); });
+ [this](const auto& parent, const auto& navi, const auto& remove) {return this->showHistoryUI(parent, navi, remove);});
m_bookmarkManagerUI->removeSelectedItemsFromHistory.connect(
- [this]{ m_historyUI->removeSelectedHistoryItems(); });
+ [this] {m_historyUI->removeSelectedHistoryItems();});
m_bookmarkManagerUI->isEngineSecretMode.connect(
- [this]{ return m_webEngine->isSecretMode(); });
+ [this] {return m_webEngine->isSecretMode();});
}
-void SimpleUI::connectFindOnPageSignals()
-{
+void SimpleUI::connectFindOnPageSignals() {
assert(m_findOnPageUI.get());
- m_findOnPageUI->closeFindOnPageUIClicked.connect(
- [this] {
- this->closeFindOnPageUI();
- });
+ m_findOnPageUI->closeFindOnPageUIClicked.connect([this] {
+ this->closeFindOnPageUI();
+ });
m_findOnPageUI->startFindingWord.connect(
- [this](const auto& fdata){ m_webEngine->findWord(fdata.input_str, fdata.forward, fdata.func, fdata.data); });
+ [this](const auto& fdata) {m_webEngine->findWord(fdata.input_str, fdata.forward, fdata.func, fdata.data);});
}
-void SimpleUI::connectSettingsSignals()
-{
+void SimpleUI::connectSettingsSignals() {
assert(m_settingsManager.get());
// SETTINGS OVERALL
m_settingsManager->connectOpenSignals();
- SPSC.closeSettingsUIClicked.connect(
- [this]{ this->popTheStack(); });
+ SPSC.closeSettingsUIClicked.connect([this] {this->popTheStack();});
SPSC.showSettings.connect(
- [this](const auto& settings){ this->showSettings(settings); });
+ [this](const auto& settings) {this->showSettings(settings);});
SPSC.getWebEngineSettingsParam.connect(
- [this](const auto& key){ return m_webEngine->getSettingsParam(key); });
+ [this](const auto& key) {return m_webEngine->getSettingsParam(key);});
SPSC.getWebEngineSettingsParamString.connect(
- [this](const auto& key){ return m_storageService->getSettingsStorage().getParamString(key); });
+ [this](const auto& key) {return m_storageService->getSettingsStorage().getParamString(key);});
SPSC.setWebEngineSettingsParam.connect(
- [this](const auto& key, const auto& value){ m_webEngine->setSettingsParam(key, value); });
+ [this](const auto& key, const auto& value) {m_webEngine->setSettingsParam(key, value);});
SPSC.setWebEngineSettingsParam.connect(
- [this](const auto& key, const auto& value){ m_storageService->getSettingsStorage().setParam(key, value); });
+ [this](const auto& key, const auto& value) {m_storageService->getSettingsStorage().setParam(key, value);});
SPSC.setWebEngineSettingsParamString.connect(
- [this](const auto& key, const auto& value){ m_storageService->getSettingsStorage().setParamString(key, value); });
- SPSC.isLandscape.connect(
- [this]{ return this->isLandscape(); });
+ [this](const auto& key, const auto& value) {m_storageService->getSettingsStorage().setParamString(key, value);});
+ SPSC.isLandscape.connect([this] {return this->isLandscape();});
SPSC.settingsBaseShowRadioPopup.connect(
- [this]{ this->onDefSearchEngineClicked(); });
+ [this] {this->onDefSearchEngineClicked();});
SPSC.settingsSaveContentToRadioPopup.connect(
- [this]{ this->onSaveContentToClicked(); });
+ [this] {this->onSaveContentToClicked();});
m_settingsManager->init(m_viewManager.getContent());
SPSC.requestCurrentPage.connect(
- [this]{ return requestSettingsCurrentPage(); });
- SPSC.showTextPopup.connect(
- [this]{ this->selectSettingsOtherPageChange(); });
+ [this] {return requestSettingsCurrentPage();});
+ SPSC.showTextPopup.connect([this] {this->selectSettingsOtherPageChange();});
SPSC.deleteSelectedDataClicked.connect(
- [this](const auto& opt){ this->settingsDeleteSelectedData(opt); });
+ [this](const auto& opt) {this->settingsDeleteSelectedData(opt);});
SPSC.userAgentItemClicked.connect(
- [this](const auto& ua){ this->settingsOverrideUseragent(ua); });
+ [this](const auto& ua) {this->settingsOverrideUseragent(ua);});
}
-void SimpleUI::connectWebEngineSignals()
-{
- m_webEngine->minimizeBrowser.connect(
- [this]{ this->minimizeBrowser(); });
+void SimpleUI::connectWebEngineSignals() {
+ m_webEngine->minimizeBrowser.connect([this] {this->minimizeBrowser();});
m_webEngine->uriChanged.connect(
- [this](const auto& url){ m_webPageUI->getURIEntry().changeUri(url); });
+ [this](const auto& url) {m_webPageUI->getURIEntry().changeUri(url);});
m_webEngine->downloadStarted.connect(
- [this](const auto& status){ this->downloadStarted(status); });
+ [this](const auto& status) {this->downloadStarted(status);});
m_webEngine->backwardEnableChanged.connect(
- [this](const auto& enabled){ m_webPageUI->setBackButtonEnabled(enabled); });
+ [this](const auto& enabled) {m_webPageUI->setBackButtonEnabled(enabled);});
m_webEngine->forwardEnableChanged.connect(
- [this](const auto& enabled){ m_webPageUI->setForwardButtonEnabled(enabled); });
- m_webEngine->loadStarted.connect(
- [this]{ this->loadStarted(); });
+ [this](const auto& enabled) {m_webPageUI->setForwardButtonEnabled(enabled);});
+ m_webEngine->loadStarted.connect([this] {this->loadStarted();});
m_webEngine->loadProgress.connect(
- [this](const auto& progress){ m_webPageUI->progressChanged(progress); });
+ [this](const auto& progress) {m_webPageUI->progressChanged(progress);});
#if DUMMY_BUTTON
m_webEngine->focusWebView.connect(
- [this]{ this->m_webPageUI->setDummyButtonFocus(); });
+ [this] {this->m_webPageUI->setDummyButtonFocus();});
#endif
- m_webEngine->loadFinished.connect(
- [this]{ this->loadFinished(); });
- m_webEngine->loadStop.connect(
- [this]{ this->loadFinished(); });
+ m_webEngine->loadFinished.connect([this] {this->loadFinished();});
+ m_webEngine->loadStop.connect([this] {this->loadFinished();});
m_webEngine->tabCreated.connect(
- [this]{ m_webPageUI->setTabsNumber(m_webEngine->tabsCount()); });
- m_webEngine->checkIfCreate.connect(
- [this]{ return this->checkIfCreate(); });
+ [this] {m_webPageUI->setTabsNumber(m_webEngine->tabsCount());});
+ m_webEngine->checkIfCreate.connect([this] {return this->checkIfCreate();});
m_webEngine->tabClosed.connect(
- [this](const auto& id){ this->engineTabClosed(id); });
+ [this](const auto& id) {this->engineTabClosed(id);});
m_webEngine->IMEStateChanged.connect(
- [this](const auto& status){ this->setwvIMEStatus(status); });
- m_webEngine->switchToWebPage.connect(
- [this]{ this->switchViewToWebPage(); });
- m_webEngine->favIconChanged.connect(
- [this](const auto& icon){
- if (!m_webEngine->isLoading())
- m_historyService->updateHistoryItemFavicon(m_webEngine->getURI(), icon);
+ [this](const auto& status) {this->setwvIMEStatus(status);});
+ m_webEngine->switchToWebPage.connect([this] {this->switchViewToWebPage();});
+ m_webEngine->favIconChanged.connect([this](const auto& icon) {
+ if (!m_webEngine->isLoading())
+ m_historyService->updateHistoryItemFavicon(m_webEngine->getURI(), icon);
});
- m_webEngine->windowCreated.connect(
- [this]{ switchViewToWebPage(); });
+ m_webEngine->windowCreated.connect([this] {switchViewToWebPage();});
m_webEngine->createTabId.connect(
- [this]{ m_webEngine->onTabIdCreated(m_tabService->createTabId()); });
+ [this] {m_webEngine->onTabIdCreated(m_tabService->createTabId());});
m_webEngine->snapshotCaptured.connect(
- [this](const auto& snap, const auto& type){ this->onSnapshotCaptured(snap, type); });
- m_webEngine->rotatePrepared.connect(
- [this]{ this->rotatePrepared(); });
+ [this](const auto& snap, const auto& type) {this->onSnapshotCaptured(snap, type);});
+ m_webEngine->rotatePrepared.connect([this] {this->rotatePrepared();});
m_webEngine->switchToQuickAccess.connect(
- [this]{ this->switchViewToQuickAccess(); });
+ [this] {this->switchViewToQuickAccess();});
m_webEngine->setCertificatePem.connect(
- [this](const auto& host, const auto& pem){ m_certificateContents->saveCertificateInfo(host, pem); });
+ [this](const auto& host, const auto& pem) {m_certificateContents->saveCertificateInfo(host, pem);});
m_webEngine->setWrongCertificatePem.connect(
- [this](const auto& host, const auto& pem){ m_certificateContents->saveWrongCertificateInfo(host, pem); });
+ [this](const auto& host, const auto& pem) {m_certificateContents->saveWrongCertificateInfo(host, pem);});
m_webEngine->fullscreenModeSet.connect(
- [this](const auto& state){ m_webPageUI->fullscreenModeSet(state); });
+ [this](const auto& state) {m_webPageUI->fullscreenModeSet(state);});
m_webEngine->confirmationRequest.connect(
- [this](const auto& conf){ this->handleConfirmationRequest(conf); });
- m_webEngine->getRotation.connect(
- [this]{ return this->getRotation(); });
+ [this](const auto& conf) {this->handleConfirmationRequest(conf);});
+ m_webEngine->getRotation.connect([this] {return this->getRotation();});
m_webEngine->openFindOnPage.connect(
- [this](const auto& str){ this->showFindOnPageUI(str); });
- m_webEngine->closeFindOnPage.connect(
- [this]{ this->closeFindOnPageUI(); });
+ [this](const auto& str) {this->showFindOnPageUI(str);});
+ m_webEngine->closeFindOnPage.connect([this] {this->closeFindOnPageUI();});
m_webEngine->unsecureConnection.connect(
- [this]{ this->showUnsecureConnectionPopup(); });
+ [this] {this->showUnsecureConnectionPopup();});
m_webEngine->registerHWKeyCallback.connect(
- [this]{ m_platformInputManager->registerHWKeyCallback(m_webEngine->getLayout()); });
+ [this] {m_platformInputManager->registerHWKeyCallback(m_webEngine->getLayout());});
m_webEngine->unregisterHWKeyCallback.connect(
- [this]{ m_platformInputManager->unregisterHWKeyCallback(m_webEngine->getLayout()); });
+ [this] {m_platformInputManager->unregisterHWKeyCallback(m_webEngine->getLayout());});
m_webEngine->urlbarOffsetSet.connect(
- [this](const auto& offset){ m_webPageUI->urlbarOffsetSet(offset); });
+ [this](const auto& offset) {m_webPageUI->urlbarOffsetSet(offset);});
m_webEngine->bottombarOffsetSet.connect(
- [this](const auto& offset){ m_webPageUI->bottombarOffsetSet(offset); });
+ [this](const auto& offset) {m_webPageUI->bottombarOffsetSet(offset);});
m_webEngine->createSearchQuery.connect(
- [this](const std::string& s){ return this->createSearchQuery(s); });
- m_webEngine->changeUIColor.connect(
- [this](int r, int g, int b, int a){
- m_webPageUI->changeUIColor(r,g,b,a);
+ [this](const std::string& s) {return this->createSearchQuery(s);});
+ m_webEngine->changeUIColor.connect([this](int r, int g, int b, int a) {
+ m_webPageUI->changeUIColor(r, g, b, a);
});
m_webEngine->installPWA.connect(
- [this](const std::string& s, const std::string& p, const std::string& sn) {
- return m_storageService->getPWAStorage().installPWAItem(s, p, sn);
- });
+ [this](const std::string& s, const std::string& p, const std::string& sn) {
+ return m_storageService->getPWAStorage().installPWAItem(s, p, sn);
+ });
m_webEngine->storePWAShortcut.connect(
- [this](const unsigned& id, const std::string& shortcut){
- return m_storageService->getPWAStorage().storePWAShortcut(id, shortcut);
- });
+ [this](const unsigned& id, const std::string& shortcut) {
+ return m_storageService->getPWAStorage().storePWAShortcut(id, shortcut);
+ });
m_webEngine->pushSignal.connect(
- [this](const char *sender_id, const char* push_data) { return this->handlePushSignal(sender_id, push_data); }
- );
+ [this](const char *sender_id, const char* push_data) {return this->handlePushSignal(sender_id, push_data);});
m_webEngine->storePermission.connect(
- [this](const std::string& origin, const bool& state) {
- return m_storageService->getPWAStorage().addPermission(origin, state); }
- );
- m_webEngine->getPermissionId.connect(
- [this](const std::string& origin) {
- return m_storageService->getPWAStorage().getPermissionId(origin); }
- );
+ [this](const std::string& origin, const bool& state) {
+ return m_storageService->getPWAStorage().addPermission(origin, state);});
+ m_webEngine->getPermissionId.connect([this](const std::string& origin) {
+ return m_storageService->getPWAStorage().getPermissionId(origin);});
m_webEngine->updatePermissionState.connect(
- [this](const int& id, const bool& state) {
- return m_storageService->getPWAStorage().updatePermissionState(id, state); }
- );
- m_webEngine->getPermissionsMap.connect(
- [this]{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- return m_storageService->getPWAStorage().getPermissionsMap();
+ [this](const int& id, const bool& state) {
+ return m_storageService->getPWAStorage().updatePermissionState(id, state);});
+ m_webEngine->getPermissionsMap.connect([this] {
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ return m_storageService->getPWAStorage().getPermissionsMap();
});
}
-std::string SimpleUI::handlePushSignal(const char *sender_id, const char* data)
-{
+std::string SimpleUI::handlePushSignal(const char *sender_id,
+ const char* data) {
BROWSER_LOGD("[%s:%d] %s", __PRETTY_FUNCTION__, __LINE__, sender_id);
int id = m_storageService->getPWAStorage().getPWAIdFromPushId(sender_id);
if (id) {
app_context_h context = nullptr;
- app_state_e state ;
+ app_state_e state;
std::string appId = "org.tizen.browser";
- std::string shortName = m_storageService->getPWAStorage().getPWAShortName(id);
+ std::string shortName =
+ m_storageService->getPWAStorage().getPWAShortName(id);
std::string result = shortName + std::to_string(id);
- bool isInactive =
- (app_manager_get_app_context_by_instance_id(
- appId.c_str(), result.c_str(), &context) == APP_MANAGER_ERROR_NO_SUCH_APP);
- if(context) {
- app_context_get_app_state( context, &state);
- BROWSER_LOGD("[%s:%d] instance-id=%s , isInactive=%d, state=%d", __PRETTY_FUNCTION__, __LINE__, result.c_str(),isInactive,state);
-
- if (state==APP_STATE_FOREGROUND) {
+ bool isInactive = (app_manager_get_app_context_by_instance_id(
+ appId.c_str(), result.c_str(), &context) == APP_MANAGER_ERROR_NO_SUCH_APP);
+ if (context) {
+ app_context_get_app_state(context, &state);
+ BROWSER_LOGD("[%s:%d] instance-id=%s , isInactive=%d, state=%d",
+ __PRETTY_FUNCTION__, __LINE__, result.c_str(), isInactive, state);
+
+ if (state == APP_STATE_FOREGROUND) {
BROWSER_LOGD("[%s:%d] instance id active %s", __PRETTY_FUNCTION__, __LINE__, result.c_str());
return std::string(data);
} else {
BROWSER_LOGD("[%s:%d] instance id inactive %s", __PRETTY_FUNCTION__, __LINE__, result.c_str());
createPWANotification(id, data);
}
- }
- else{
+ } else {
BROWSER_LOGD("[%s:%d] instance id inactive %s", __PRETTY_FUNCTION__, __LINE__, result.c_str());
createPWANotification(id, data);
}
- }
- else {
+ } else {
BROWSER_LOGD("no instance id");
return std::string(data);
}
return std::string();
}
-void SimpleUI::createPWANotification(const unsigned& id, const std::string& body)
-{
+void SimpleUI::createPWANotification(const unsigned& id,
+ const std::string& body) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto shortcut = m_storageService->getPWAStorage().getPWAShortcut(id);
int ret = NOTIFICATION_ERROR_NONE;
noti_h = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_text(
- noti_h,
- NOTIFICATION_TEXT_TYPE_TITLE,
- title.c_str(),
- nullptr,
- NOTIFICATION_VARIABLE_TYPE_NONE);
+ ret = notification_set_text(noti_h, NOTIFICATION_TEXT_TYPE_TITLE,
+ title.c_str(), nullptr, NOTIFICATION_VARIABLE_TYPE_NONE);
if (ret != NOTIFICATION_ERROR_NONE) {
BROWSER_LOGD("[%s]: PWANotification >> Title Error", __func__);
return;
}
- ret = notification_set_text(
- noti_h,
- NOTIFICATION_TEXT_TYPE_CONTENT,
- body.c_str(),
- nullptr,
- NOTIFICATION_VARIABLE_TYPE_NONE);
+ ret = notification_set_text(noti_h, NOTIFICATION_TEXT_TYPE_CONTENT,
+ body.c_str(), nullptr, NOTIFICATION_VARIABLE_TYPE_NONE);
if (ret != NOTIFICATION_ERROR_NONE) {
BROWSER_LOGD("[%s]: PWANotification >> Contents Error", __func__);
notification_free(noti_h);
- return ;
+ return;
}
- ret = notification_set_display_applist(
- noti_h,
- NOTIFICATION_DISPLAY_APP_TICKER | NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
+ ret = notification_set_display_applist(noti_h, NOTIFICATION_DISPLAY_APP_TICKER | NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
if (ret != NOTIFICATION_ERROR_NONE) {
BROWSER_LOGD("[%s]: PWANotification >> Display Error", __func__);
notification_free(noti_h);
return;
}
- if (app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW) != APP_CONTROL_ERROR_NONE) {
+ if (app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW)
+ != APP_CONTROL_ERROR_NONE) {
BROWSER_LOGD("Fail to set app_control operation");
app_control_destroy(app_control);
notification_free(noti_h);
return;
}
- if (app_control_set_app_id(app_control, "org.tizen.browser") != APP_CONTROL_ERROR_NONE) {
+ if (app_control_set_app_id(app_control, "org.tizen.browser")
+ != APP_CONTROL_ERROR_NONE) {
BROWSER_LOGD("Fail to app_control_set_app_id");
app_control_destroy(app_control);
notification_free(noti_h);
return;
}
- if (app_control_set_uri(app_control, shortcut.c_str()) != APP_CONTROL_ERROR_NONE) {
+ if (app_control_set_uri(app_control, shortcut.c_str()) != APP_CONTROL_ERROR_NONE) {
BROWSER_LOGD("Fail to app_control_set_uri");
app_control_destroy(app_control);
notification_free(noti_h);
return;
}
- int err = notification_set_launch_option(noti_h, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void*)app_control);
+ int err = notification_set_launch_option(noti_h,
+ NOTIFICATION_LAUNCH_OPTION_APP_CONTROL,
+ (void*) app_control);
- BROWSER_LOGD("notification_set_launch_option >> NOTIFICATION_LAUNCH_OPTION_APP_CONTROL");
+ BROWSER_LOGD(
+ "notification_set_launch_option >> NOTIFICATION_LAUNCH_OPTION_APP_CONTROL");
if (err != NOTIFICATION_ERROR_NONE) {
- BROWSER_LOGD("notification_set_execute_option is failed with err[%d]", err);
+ BROWSER_LOGD("notification_set_execute_option is failed with err[%d]",
+ err);
app_control_destroy(app_control);
notification_free(noti_h);
return;
}
}
-void SimpleUI::connectTabServiceSignals()
-{
+void SimpleUI::connectTabServiceSignals() {
m_tabService->generateThumb.connect(
- [this](const auto& id){ this->onGenerateThumb(id); });
+ [this](const auto& id) {this->onGenerateThumb(id);});
m_tabService->generateFavicon.connect(
- [this](const auto& id){ m_tabService->updateTabItemFavicon(id, m_webEngine->getFavicon()); });
+ [this](const auto& id) {m_tabService->updateTabItemFavicon(id, m_webEngine->getFavicon());});
}
-void SimpleUI::connectPlatformInputSignals()
-{
+void SimpleUI::connectPlatformInputSignals() {
m_platformInputManager->returnPressed.connect(elm_exit);
m_platformInputManager->backPressed.connect(
- [this]{ this->onBackPressed(); });
+ [this] {this->onBackPressed();});
m_platformInputManager->menuButtonPressed.connect(
- [this]{ this->onMenuButtonPressed(); });
+ [this] {this->onMenuButtonPressed();});
m_platformInputManager->XF86BackPressed.connect(
- [this]{ this->onXF86BackPressed(); });
+ [this] {this->onXF86BackPressed();});
m_platformInputManager->XF86MenuPressed.connect(
- [this]{ this->onXF86MenuPressed(); });
+ [this] {this->onXF86MenuPressed();});
}
-void SimpleUI::connectCertificateSignals()
-{
+void SimpleUI::connectCertificateSignals() {
m_certificateContents->getHostCertList.connect(
- [this]{ return m_storageService->getCertificateStorage().getHostCertList(); });
+ [this] {return m_storageService->getCertificateStorage().getHostCertList();});
m_certificateContents->addOrUpdateCertificateEntry.connect(
- [this](const auto& pem, const auto& host, const auto& allow){
- m_storageService->getCertificateStorage().addOrUpdateCertificateEntry(pem, host, allow);
- });
+ [this](const auto& pem, const auto& host, const auto& allow) {
+ m_storageService->getCertificateStorage().addOrUpdateCertificateEntry(pem, host, allow);
+ });
}
-void SimpleUI::connectStorageSignals()
-{
+void SimpleUI::connectStorageSignals() {
m_storageService->getSettingsStorage().setWebEngineSettingsParam.connect(
- [this](const auto& param, const auto& value){ m_webEngine->setSettingsParam(param, value); });
+ [this](const auto& param, const auto& value) {m_webEngine->setSettingsParam(param, value);});
}
-void SimpleUI::connectUISignals()
-{
+void SimpleUI::connectUISignals() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- m_viewManager.isLandscape.connect(
- [this]{ return this->isLandscape(); });
+ m_viewManager.isLandscape.connect([this] {return this->isLandscape();});
connectWebPageSignals();
connectQuickAccessSignals();
connectTabsSignals();
connectBookmarkManagerSignals();
}
-void SimpleUI::connectPWASignals()
-{
+void SimpleUI::connectPWASignals() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
connectStorageSignals();
- m_platformInputManager->backPressed.connect(boost::bind(&SimpleUI::onPWABackPressed, this));
+ m_platformInputManager->backPressed.connect(
+ boost::bind(&SimpleUI::onPWABackPressed, this));
- m_webEngine->loadFinished.connect([this]{ this->m_splash_screen.hide(); });
- m_webEngine->rotatePrepared.connect([this]{ this->rotatePrepared(); });
+ m_webEngine->loadFinished.connect([this] {this->m_splash_screen.hide();});
+ m_webEngine->rotatePrepared.connect([this] {this->rotatePrepared();});
#if PWE_SHUB
m_webEngine->getPWAServiceWorkerURI.connect(
- [this] { return m_pwa.getPWAinfo().serviceWorkerUri; });
+ [this] {return m_pwa.getPWAinfo().serviceWorkerUri;});
m_webEngine->getPWAURI.connect(
- [this] { return m_pwa.getPWAinfo().uri; });
+ [this] {return m_pwa.getPWAinfo().uri;});
#endif
m_webEngine->getPWAInstanceIDSignal.connect(
- [this] { return m_pushPwaData.getInstanceId(); });
+ [this] {return m_pushPwaData.getInstanceId();});
m_webEngine->getPWADataSignal.connect(
- [this] { return m_pushPwaData.getData(); });
+ [this] {return m_pushPwaData.getData();});
m_webEngine->pushSignal.connect(
- [this](const char *sender_id, const char* push_data) {
- return this->handlePushSignal(sender_id, push_data);
- });
+ [this](const char *sender_id, const char* push_data) {
+ return this->handlePushSignal(sender_id, push_data);
+ });
m_webEngine->storePermission.connect(
- [this](const std::string& origin, const bool& state) {
- return m_storageService->getPWAStorage().addPermission(origin, state);
- });
- m_webEngine->getPermissionId.connect(
- [this](const std::string& origin) {
- return m_storageService->getPWAStorage().getPermissionId(origin);
+ [this](const std::string& origin, const bool& state) {
+ return m_storageService->getPWAStorage().addPermission(origin, state);
+ });
+ m_webEngine->getPermissionId.connect([this](const std::string& origin) {
+ return m_storageService->getPWAStorage().getPermissionId(origin);
});
m_webEngine->updatePermissionState.connect(
- [this](const int& id, const bool& state) {
- return m_storageService->getPWAStorage().updatePermissionState(id, state);
- });
- m_webEngine->windowCreated.connect( [this]{ switchViewToWebPage(); });
- m_webEngine->getPermissionsMap.connect(
- [this]{
- BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- return m_storageService->getPWAStorage().getPermissionsMap();
+ [this](const int& id, const bool& state) {
+ return m_storageService->getPWAStorage().updatePermissionState(id, state);
+ });
+ m_webEngine->windowCreated.connect([this] {switchViewToWebPage();});
+ m_webEngine->getPermissionsMap.connect([this] {
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ return m_storageService->getPWAStorage().getPermissionsMap();
});
}
-void SimpleUI::connectModelSignals()
-{
+void SimpleUI::connectModelSignals() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
connectWebEngineSignals();
connectHistorySignals();
connectStorageSignals();
}
-void SimpleUI::initUIServices()
-{
+void SimpleUI::initUIServices() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto viewManager(m_viewManager.getContent());
m_bookmarkManagerUI->init(viewManager);
}
-void SimpleUI::initModelServices()
-{
+void SimpleUI::initModelServices() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
assert(m_webEngine.get());
m_certificateContents->init();
}
-void SimpleUI::pushViewToStack(const sAUI& view)
-{
+void SimpleUI::pushViewToStack(const sAUI& view) {
m_viewManager.pushViewToStack(view);
enableManualRotation(isManualRotation(view));
if (appcore_flush_memory() == -1)
BROWSER_LOGW("[%s] appcore_flush_memory error!", __PRETTY_FUNCTION__);
}
-void SimpleUI::popTheStack()
-{
+void SimpleUI::popTheStack() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_viewManager.popTheStack();
enableManualRotation(isManualRotation(m_viewManager.topOfStack()));
BROWSER_LOGW("[%s] appcore_flush_memory error!", __PRETTY_FUNCTION__);
}
-void SimpleUI::popStackTo(const sAUI& view)
-{
+void SimpleUI::popStackTo(const sAUI& view) {
m_viewManager.popStackTo(view);
enableManualRotation(isManualRotation(view));
if (appcore_flush_memory() == -1)
BROWSER_LOGW("[%s] appcore_flush_memory error!", __PRETTY_FUNCTION__);
}
-void SimpleUI::switchViewToWebPage()
-{
+void SimpleUI::switchViewToWebPage() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_webEngine->isSuspended())
m_webEngine->resume();
if (!m_pwa.isActive())
- m_webPageUI->switchViewToWebPage(m_webEngine->getLayout(),
- m_webEngine->getURI(),
- m_webEngine->isLoading());
+ m_webPageUI->switchViewToWebPage(m_webEngine->getLayout(), m_webEngine->getURI(), m_webEngine->isLoading());
else
m_webPageMin->setMainContent(m_webEngine->getLayout());
}
-void SimpleUI::switchToTab(const basic_webengine::TabId& tabId)
-{
+void SimpleUI::switchToTab(const basic_webengine::TabId& tabId) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_webEngine->switchToTab(tabId);
if (!m_pwa.isActive())
m_webPageUI->switchViewToWebPage(m_webEngine->getLayout(),
- m_webEngine->getURI(),
- m_webEngine->isLoading());
+ m_webEngine->getURI(), m_webEngine->isLoading());
else
m_webPageMin->setMainContent(m_webEngine->getLayout());
}
-void SimpleUI::switchViewToQuickAccess()
-{
+void SimpleUI::switchViewToQuickAccess() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_webPageUI->switchViewToQuickAccess(m_quickAccess->getContent());
}
void SimpleUI::openNewTab(const std::string &uri, const std::string& title,
- const boost::optional<int> adaptorId, bool desktopMode,
- basic_webengine::TabOrigin origin)
-{
+ const boost::optional<int> adaptorId, bool desktopMode,
+ basic_webengine::TabOrigin origin) {
BROWSER_LOGD("[%s:%d] uri =%s", __PRETTY_FUNCTION__, __LINE__, uri.c_str());
- basic_webengine::TabId tab = m_webEngine->addTab(uri,
- adaptorId, title, desktopMode, origin);
+ basic_webengine::TabId tab = m_webEngine->addTab(uri, adaptorId, title,
+ desktopMode, origin);
if (tab == basic_webengine::TabId::NONE) {
BROWSER_LOGW("[%s:%d] New tab is not created!", __PRETTY_FUNCTION__, __LINE__);
return;
switchToTab(tab);
}
-void SimpleUI::closeTab(const basic_webengine::TabId& id)
-{
+void SimpleUI::closeTab(const basic_webengine::TabId& id) {
BROWSER_LOGD("[%s:%d] id: %d", __PRETTY_FUNCTION__, __LINE__, id.get());
m_tabService->removeTab(id);
m_webEngine->closeTab(id);
updateView();
}
-bool SimpleUI::checkBookmark()
-{
+bool SimpleUI::checkBookmark() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- if(m_webPageUI->stateEquals(WPUState::QUICK_ACCESS))
+ if (m_webPageUI->stateEquals(WPUState::QUICK_ACCESS))
return false;
- if(m_favoriteService->bookmarkExists(m_webEngine->getURI())) {
- BROWSER_LOGD("[%s] There is bookmark for this site [%s], set indicator on!", __func__, m_webEngine->getURI().c_str());
+ if (m_favoriteService->bookmarkExists(m_webEngine->getURI())) {
+ BROWSER_LOGD(
+ "[%s] There is bookmark for this site [%s], set indicator on!",
+ __func__, m_webEngine->getURI().c_str());
return true;
- }
- else {
- BROWSER_LOGD("[%s] There is no bookmark for this site [%s], set indicator off", __func__, m_webEngine->getURI().c_str());
+ } else {
+ BROWSER_LOGD(
+ "[%s] There is no bookmark for this site [%s], set indicator off",
+ __func__, m_webEngine->getURI().c_str());
return false;
}
}
-void SimpleUI::openURL(const std::string& url)
-{
- if (m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE) || m_webPageUI->stateEquals(WPUState::MAIN_INCOGNITO_PAGE))
+void SimpleUI::openURL(const std::string& url) {
+ if (m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE)
+ || m_webPageUI->stateEquals(WPUState::MAIN_INCOGNITO_PAGE))
openURL(url, "", m_webEngine->isDesktopMode());
else
openURL(url, "", false);
}
-void SimpleUI::openURL(const std::string& url, const std::string& title, bool desktopMode)
-{
+void SimpleUI::openURL(const std::string& url, const std::string& title,
+ bool desktopMode) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_webPageUI) {
popStackTo(m_webPageUI);
- if (tabsCount() == 0 ||
- (m_webPageUI->stateEquals(WPUState::QUICK_ACCESS) && m_webPageUI->shouldOpenNewTab())) {
+ if (tabsCount() == 0
+ || (m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)
+ && m_webPageUI->shouldOpenNewTab())) {
openNewTab(url, title, boost::none, desktopMode, basic_webengine::TabOrigin::QUICKACCESS);
} else {
if (m_webEngine->isSuspended())
}
}
-void SimpleUI::onClearHistoryAllClicked()
-{
+void SimpleUI::onClearHistoryAllClicked() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_historyService->clearAllHistory();
m_storageService->getPWAStorage().deletePWAItems();
}
-void SimpleUI::onBookmarkClicked(services::SharedBookmarkItem bookmarkItem)
-{
+void SimpleUI::onBookmarkClicked(services::SharedBookmarkItem bookmarkItem) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (bookmarkItem->is_folder())
- m_bookmarkManagerUI->addBookmarkItems(bookmarkItem, m_favoriteService->getAllBookmarkItems(bookmarkItem->getId()));
- else {
+ m_bookmarkManagerUI->addBookmarkItems(bookmarkItem,
+ m_favoriteService->getAllBookmarkItems(bookmarkItem->getId()));
+ else
openURL(bookmarkItem->getAddress());
- }
}
-void SimpleUI::onBookmarkEdit(services::SharedBookmarkItem bookmarkItem)
-{
+void SimpleUI::onBookmarkEdit(services::SharedBookmarkItem bookmarkItem) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (bookmarkItem->is_folder()) {
- InputPopup *inputPopup =
- InputPopup::createPopup(
- m_viewManager.getContent(),
- "IDS_BR_OPT_RENAME_FOLDER",
- "",
- bookmarkItem->getTitle(),
- "IDS_BR_OPT_RENAME",
- "IDS_BR_SK_CANCEL_ABB");
+ InputPopup *inputPopup = InputPopup::createPopup(
+ m_viewManager.getContent(), "IDS_BR_OPT_RENAME_FOLDER",
+ "",
+ bookmarkItem->getTitle(), "IDS_BR_OPT_RENAME", "IDS_BR_SK_CANCEL_ABB");
services::SharedBookmarkItemList badWords =
- m_favoriteService->getFolders(bookmarkItem->getParent());
+ m_favoriteService->getFolders(bookmarkItem->getParent());
for (auto it = badWords.begin(); it != badWords.end(); ++it)
inputPopup->addBadWord((*it)->getTitle());
inputPopup->button_clicked.connect(
- [=](const auto& name) mutable { this->onEditFolderPopupClicked(name, bookmarkItem); });
+ [=](const auto& name) mutable {this->onEditFolderPopupClicked(name, bookmarkItem);});
inputPopup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
inputPopup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
inputPopup->show();
} else {
m_bookmarkFlowUI->setURL(bookmarkItem->getAddress());
}
}
-void SimpleUI::onNewFolderClicked(int parent)
-{
+void SimpleUI::onNewFolderClicked(int parent) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- InputPopup *inputPopup =
- InputPopup::createPopup(
- m_viewManager.getContent(),
- _("IDS_BR_SK3_CREATE_FOLDER"),
- "",
- "New Folder #",
- //TODO: Missing translation
- "Create",
- _("IDS_BR_SK_CANCEL_ABB"));
- services::SharedBookmarkItemList badWords = m_favoriteService->getFolders(parent);
+ InputPopup *inputPopup = InputPopup::createPopup(m_viewManager.getContent(),
+ _("IDS_BR_SK3_CREATE_FOLDER"), "", "New Folder #",
+ //TODO: Missing translation
+ "Create", _("IDS_BR_SK_CANCEL_ABB"));
+ services::SharedBookmarkItemList badWords = m_favoriteService->getFolders(
+ parent);
for (auto it = badWords.begin(); it != badWords.end(); ++it)
inputPopup->addBadWord((*it)->getTitle());
inputPopup->button_clicked.connect(
- [=](const auto& name) mutable { this->onNewFolderPopupClick(name, parent); });
+ [=](const auto& name) mutable {this->onNewFolderPopupClick(name, parent);});
inputPopup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
inputPopup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
inputPopup->show();
}
-void SimpleUI::onNewFolderPopupClick(const std::string& folder_name, int parent)
-{
+void SimpleUI::onNewFolderPopupClick(const std::string& folder_name, int parent) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_favoriteService->folderExists(folder_name, parent)) {
BROWSER_LOGD("[%s:%d] Folder already exists.", __PRETTY_FUNCTION__, __LINE__);
m_bookmarkManagerUI->addBookmarkItemCurrentFolder(folder);
}
-void SimpleUI::onNewQuickAccessClicked()
-{
+void SimpleUI::onNewQuickAccessClicked() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- auto inputPopup = InputPopup::createPopup(
- m_viewManager.getContent(),
- "Add to Quick access",
- "",
- "",
- _("IDS_BR_OPT_ADD"),
- _("IDS_BR_SK_CANCEL_ABB"));
+ auto inputPopup = InputPopup::createPopup(m_viewManager.getContent(),
+ "Add to Quick access", "", "", _("IDS_BR_OPT_ADD"), _("IDS_BR_SK_CANCEL_ABB"));
// TODO Add missing translations
inputPopup->setTip(_("Enter web address"));
inputPopup->button_clicked.connect(
- [this](const auto& url){ this->addQuickAccessItem(url, ""); });
+ [this](const auto& url) {this->addQuickAccessItem(url, "");});
inputPopup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
inputPopup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
inputPopup->show();
}
-void SimpleUI::addQuickAccessItem(const std::string &urlArg, const std::string &titleArg)
-{
+void SimpleUI::addQuickAccessItem(const std::string &urlArg,
+ const std::string &titleArg) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_storageService->getQuickAccessStorage().getQuickAccessCount() < m_qaLimit) {
-
bool refreshQAGengrid = false;
std::string url = urlArg;
std::string title = titleArg;
url = std::string(tools::PROTOCOL_HTTP) + url;
if (!m_storageService->getQuickAccessStorage().quickAccessItemExist(url)) {
-
if (titleArg.empty()) {
title = urlArg;
refreshQAGengrid = true;
}
-
if (!title.compare(0, tools::PROTOCOL_HTTP.length(), tools::PROTOCOL_HTTP))
title = title.substr(tools::PROTOCOL_HTTP.length(), std::string::npos);
else if (!title.compare(0, tools::PROTOCOL_HTTPS.length(), tools::PROTOCOL_HTTPS))
tools::BrowserImagePtr favicon = m_webEngine->getFavicon();
if (favicon) {
addedItemID = m_storageService->getQuickAccessStorage().addQuickAccessItem(
- url, title, 0, 0, true, favicon, favicon->getWidth(), favicon->getHeight());
+ url, title, 0, 0, true, favicon, favicon->getWidth(), favicon->getHeight());
} else {
addedItemID = m_storageService->getQuickAccessStorage().addQuickAccessItem(
- url, title, 0, 0, false, nullptr, 0, 0);
+ url, title, 0, 0, false, nullptr, 0, 0);
}
} else {
addedItemID = m_storageService->getQuickAccessStorage().addQuickAccessItem(
- url, title, 0, 0, false, nullptr, 0, 0);
+ url, title, 0, 0, false, nullptr, 0, 0);
}
if (refreshQAGengrid)
m_quickAccess->addQuickAccessItemBeforeADDButton(
- m_storageService->getQuickAccessStorage().getQuickAccessItem(addedItemID));
+ m_storageService->getQuickAccessStorage().getQuickAccessItem(addedItemID));
tools::EflTools::createToastPopup(_("IDS_BR_TPOP_WEBPAGE_ADDED_TO_QUICK_ACCESS_LIST"));
TextPopup *popup = TextPopup::createPopup(m_viewManager.getContent());
popup->addButton(OK);
popup->setTitle("Couldn't add shortcut"); //TODO: missing translation
- popup->setMessage("The maximum number of Quick access shortcuts has been reached. "
- "Delete some shortcuts and try again."); //TODO: Missing translation
+ popup->setMessage(
+ "The maximum number of Quick access shortcuts has been reached. "
+ "Delete some shortcuts and try again."); //TODO: Missing translation
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
}
-void SimpleUI::editQuickAccess()
-{
+void SimpleUI::editQuickAccess() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_quickAccess->editQuickAccess();
pushViewToStack(m_webPageUI->getQuickAccessEditUI());
}
-void SimpleUI::deleteMostVisited()
-{
+void SimpleUI::deleteMostVisited() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_quickAccess->deleteMostVisited();
pushViewToStack(m_webPageUI->getQuickAccessEditUI());
}
-void SimpleUI::onEditFolderPopupClicked(const std::string& newName, services::SharedBookmarkItem item)
-{
+void SimpleUI::onEditFolderPopupClicked(const std::string& newName,
+ services::SharedBookmarkItem item) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- m_favoriteService->editBookmark(item->getId(), "", newName, item->getParent());
- services::SharedBookmarkItem parentItem = m_favoriteService->getBookmarkItem(item->getParent());
+ m_favoriteService->editBookmark(item->getId(), "", newName,
+ item->getParent());
+ services::SharedBookmarkItem parentItem =
+ m_favoriteService->getBookmarkItem(item->getParent());
if (m_viewManager.topOfStack() == m_bookmarkManagerUI)
- m_bookmarkManagerUI->addBookmarkItems(nullptr, m_favoriteService->getAllBookmarkItems(parentItem->getId()));
+ m_bookmarkManagerUI->addBookmarkItems(nullptr,
+ m_favoriteService->getAllBookmarkItems(parentItem->getId()));
tools::EflTools::createToastPopup(_("IDS_BR_TPOP_FOLDER_RENAMED"));
}
-void SimpleUI::hideBottomBar(const bool& state)
-{
+void SimpleUI::hideBottomBar(const bool& state) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_pwa.isActive())
return;
- if (m_webEngine->getLayout() && !m_webPageUI->stateEquals(WPUState::QUICK_ACCESS))
+ if (m_webEngine->getLayout()
+ && !m_webPageUI->stateEquals(WPUState::QUICK_ACCESS))
m_webEngine->setIMEState(state);
else
m_webPageUI->bottombarOffsetSet(
- -boost::any_cast<int>(Config::getInstance().get(CONFIG_KEY::URL_BAR_HEIGHT)) * (state ? 2 : 1));
+ -boost::any_cast<int>(
+ Config::getInstance().get(CONFIG_KEY::URL_BAR_HEIGHT)) * (state ? 2 : 1));
}
-void SimpleUI::onUrlIMEOpened(void* data, Evas_Object*, void*)
-{
+void SimpleUI::onUrlIMEOpened(void* data, Evas_Object*, void*) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
SimpleUI* self = static_cast<SimpleUI*>(data);
self->setwvIMEStatus(true);
self->hideBottomBar(true);
}
-void SimpleUI::onUrlIMEClosed(void* data, Evas_Object*, void*)
-{
+void SimpleUI::onUrlIMEClosed(void* data, Evas_Object*, void*) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
SimpleUI* self = static_cast<SimpleUI*>(data);
self->setwvIMEStatus(false);
self->hideBottomBar(false);
}
-void SimpleUI::onSnapshotCaptured(std::shared_ptr<tools::BrowserImage> snapshot, tools::SnapshotType snapshot_type)
-{
+void SimpleUI::onSnapshotCaptured(std::shared_ptr<tools::BrowserImage> snapshot,
+ tools::SnapshotType snapshot_type) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
switch (snapshot_type) {
case tools::SnapshotType::ASYNC_LOAD_FINISHED:
- if (m_webEngine->isSecretMode()) {
- m_tabService->saveThumbCache(m_webEngine->currentTabId(), snapshot);
- } else {
- m_historyService->updateHistoryItemSnapshot(m_webEngine->getURI(), snapshot);
- m_tabService->updateTabItemSnapshot(m_webEngine->currentTabId(), snapshot);
- }
+ if (m_webEngine->isSecretMode()) {
+ m_tabService->saveThumbCache(m_webEngine->currentTabId(), snapshot);
+ } else {
+ m_historyService->updateHistoryItemSnapshot(m_webEngine->getURI(),
+ snapshot);
+ m_tabService->updateTabItemSnapshot(m_webEngine->currentTabId(),
+ snapshot);
+ }
break;
case tools::SnapshotType::ASYNC_TAB:
- m_tabService->updateTabItemSnapshot(m_webEngine->currentTabId(), snapshot);
+ m_tabService->updateTabItemSnapshot(m_webEngine->currentTabId(), snapshot);
break;
case tools::SnapshotType::ASYNC_BOOKMARK:
- m_favoriteService->updateBookmarkItemSnapshot(m_webEngine->getURI(), snapshot);
+ m_favoriteService->updateBookmarkItemSnapshot(m_webEngine->getURI(),
+ snapshot);
break;
case tools::SnapshotType::SYNC:
- BROWSER_LOGE("Synchronized snapshot in asynchronized workflow");
+ BROWSER_LOGE("Synchronized snapshot in asynchronized workflow");
break;
default:
- BROWSER_LOGW("Snapshot type is not supported in asynchronized workflow");
+ BROWSER_LOGW("Snapshot type is not supported in asynchronized workflow");
}
}
-void SimpleUI::onGenerateThumb(basic_webengine::TabId tabId)
-{
+void SimpleUI::onGenerateThumb(basic_webengine::TabId tabId) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- const int THUMB_WIDTH = boost::any_cast<int>(
- Config::getInstance().get(CONFIG_KEY::HISTORY_TAB_SERVICE_THUMB_WIDTH));
- const int THUMB_HEIGHT = boost::any_cast<int>(
- Config::getInstance().get(CONFIG_KEY::HISTORY_TAB_SERVICE_THUMB_HEIGHT));
- tools::BrowserImagePtr snapshotImage = m_webEngine->getSnapshotData(tabId, THUMB_WIDTH, THUMB_HEIGHT, false, tools::SnapshotType::SYNC);
+ const int THUMB_WIDTH =
+ boost::any_cast<int>(
+ Config::getInstance().get(
+ CONFIG_KEY::HISTORY_TAB_SERVICE_THUMB_WIDTH));
+ const int THUMB_HEIGHT =
+ boost::any_cast<int>(
+ Config::getInstance().get(
+ CONFIG_KEY::HISTORY_TAB_SERVICE_THUMB_HEIGHT));
+ tools::BrowserImagePtr snapshotImage = m_webEngine->getSnapshotData(tabId,
+ THUMB_WIDTH, THUMB_HEIGHT, false,
+ tools::SnapshotType::SYNC);
m_tabService->updateTabItemSnapshot(tabId, snapshotImage);
}
-void SimpleUI::onXF86MenuPressed()
-{
+void SimpleUI::onXF86MenuPressed() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_viewManager.topOfStack() == m_webPageUI)
m_webPageUI->returnFocusAfterHideContextMenu();
}
-void SimpleUI::onXF86BackPressed()
-{
+void SimpleUI::onXF86BackPressed() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_wvIMEStatus && m_webPageUI->getURIEntry().hasFocus())
m_webPageUI->getURIEntry().clearFocus();
}
-void SimpleUI::onBackPressed()
-{
+void SimpleUI::onBackPressed() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- if (m_findOnPageUI->isVisible())
+ if (m_findOnPageUI->isVisible()) {
closeFindOnPageUI();
- else
- if (m_wvIMEStatus) { // if IME opened
+ } else if (m_wvIMEStatus) { // if IME opened
return;
} else if (m_popupVector.size() > 0) {
m_popupVector.back()->onBackPressed();
} else if (m_viewManager.topOfStack() == m_bookmarkManagerUI) {
m_bookmarkManagerUI->onBackPressed();
- } else if (m_viewManager.topOfStack() == m_webPageUI->getQuickAccessEditUI()) {
+ } else if (m_viewManager.topOfStack()
+ == m_webPageUI->getQuickAccessEditUI()) {
m_webPageUI->getQuickAccessEditUI()->backPressed();
} else if (m_viewManager.topOfStack() == nullptr) {
switchViewToQuickAccess();
}
#if DUMMY_BUTTON
if (m_viewManager.topOfStack() == m_webPageUI && m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE))
- m_webPageUI->setDummyButtonFocus();
+ m_webPageUI->setDummyButtonFocus();
#endif
}
-void SimpleUI::onPWABackPressed()
-{
+void SimpleUI::onPWABackPressed() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_wvIMEStatus) { // if IME opened
}
}
-void SimpleUI::dismissPopup(interfaces::AbstractPopup* popup)
-{
+void SimpleUI::dismissPopup(interfaces::AbstractPopup* popup) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- std::vector<interfaces::AbstractPopup*>::reverse_iterator it = m_popupVector.rbegin();
+ std::vector<interfaces::AbstractPopup*>::reverse_iterator it =
+ m_popupVector.rbegin();
for (; it != m_popupVector.rend(); ++it) {
if (popup == *it) {
delete *it;
m_popupVector.erase(--it.base());
if (m_popupVector.size() > 0) {
interfaces::AbstractPopup* tmp = m_popupVector.back();
- m_popupVector.pop_back(); // pop_back last popup because it'll be pushed while showing
+ m_popupVector.pop_back(); // pop_back last popup because it'll be pushed while showing
tmp->show();
}
break;
}
}
-void SimpleUI::onMenuButtonPressed()
-{
+void SimpleUI::onMenuButtonPressed() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- if (!m_popupVector.empty()) // do not show contex menu when popup is opened
+ if (!m_popupVector.empty()) // do not show contex menu when popup is opened
return;
- if (m_viewManager.topOfStack() == m_webPageUI &&
- m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE) &&
- m_webEngine->isFullScreenMode())
+ if (m_viewManager.topOfStack() == m_webPageUI
+ && m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE)
+ && m_webEngine->isFullScreenMode())
return;
if (m_findOnPageUI->isVisible()) {
closeFindOnPageUI();
}
- auto view = dynamic_cast<interfaces::AbstractContextMenu*>(m_viewManager.topOfStack().get());
+ auto view =
+ dynamic_cast<interfaces::AbstractContextMenu*>(m_viewManager.topOfStack().get());
if (view)
view->showContextMenu();
}
-bool SimpleUI::isManualRotation(const sAUI& view)
-{
+bool SimpleUI::isManualRotation(const sAUI& view) {
if (m_splash_screen.isVisible())
return false;
if (m_pwa.isActive()) {
}
}
-void SimpleUI::enableManualRotation(bool enable)
-{
+void SimpleUI::enableManualRotation(bool enable) {
m_manualRotation = enable;
- BROWSER_LOGD("[%s:%d]: %d", __PRETTY_FUNCTION__, __LINE__, m_manualRotation);
+ BROWSER_LOGD("[%s:%d]: %d", __PRETTY_FUNCTION__, __LINE__,
+ m_manualRotation);
elm_win_wm_rotation_manual_rotation_done_set(m_main_window,
- m_manualRotation ? EINA_TRUE : EINA_FALSE);
+ m_manualRotation ? EINA_TRUE : EINA_FALSE);
}
-void SimpleUI::rotatePrepared()
-{
+void SimpleUI::rotatePrepared() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- if (m_manualRotation && elm_win_wm_rotation_manual_rotation_done_get(m_main_window)) {
+ if (m_manualRotation && elm_win_wm_rotation_manual_rotation_done_get(
+ m_main_window)) {
elm_win_wm_rotation_manual_rotation_done(m_main_window);
if (m_webPageUI)
m_webPageUI->orientationChanged();
}
}
-void SimpleUI::onRotation()
-{
+void SimpleUI::onRotation() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_current_angle = m_temp_angle;
}
}
-void SimpleUI::__orientation_changed(void* data, Evas_Object*, void*)
-{
+void SimpleUI::__orientation_changed(void* data, Evas_Object*, void*) {
SimpleUI* simpleUI = static_cast<SimpleUI*>(data);
int event_angle = elm_win_rotation_get(simpleUI->m_main_window);
if (simpleUI->m_current_angle != event_angle) {
simpleUI->m_temp_angle = event_angle;
- BROWSER_LOGD("[%s:%d] previous angle: [%d] event angle: [%d]", __PRETTY_FUNCTION__, __LINE__,
- simpleUI->m_current_angle, simpleUI->m_temp_angle);
+ BROWSER_LOGD("[%s:%d] previous angle: [%d] event angle: [%d]",
+ __PRETTY_FUNCTION__, __LINE__,
+ simpleUI->m_current_angle,
+ simpleUI->m_temp_angle);
if (simpleUI->m_splash_screen.isVisible()) {
simpleUI->m_splash_screen.hide();
simpleUI->m_splash_screen.show(simpleUI->m_pwa);
}
}
-void SimpleUI::rotationType(rotationLock lock)
-{
+void SimpleUI::rotationType(rotationLock lock) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
switch (lock) {
- case rotationLock::portrait: {
- const int rots[] = {0};
- elm_win_wm_rotation_available_rotations_set(m_main_window, rots, sizeof(rots)/sizeof(int));
- break;
- }
- case rotationLock::landscape: {
- const int rots[] = {90};
- elm_win_wm_rotation_available_rotations_set(m_main_window, rots, sizeof(rots)/sizeof(int));
- break;
- }
- case rotationLock::noLock: {
- const int rots[] = {0, 90, 180, 270};
- elm_win_wm_rotation_available_rotations_set(m_main_window, rots, sizeof(rots)/sizeof(int));
- break;
- }
- default:
- BROWSER_LOGW("[%s:%d] Unknown rotationLock case!", __PRETTY_FUNCTION__, __LINE__);
+ case rotationLock::portrait: {
+ const int rots[] = { 0 };
+ elm_win_wm_rotation_available_rotations_set(m_main_window, rots,
+ sizeof(rots) / sizeof(int));
+ break;
+ }
+ case rotationLock::landscape: {
+ const int rots[] = { 90 };
+ elm_win_wm_rotation_available_rotations_set(m_main_window, rots,
+ sizeof(rots) / sizeof(int));
+ break;
+ }
+ case rotationLock::noLock: {
+ const int rots[] = { 0, 90, 180, 270 };
+ elm_win_wm_rotation_available_rotations_set(m_main_window, rots,
+ sizeof(rots) / sizeof(int));
+ break;
+ }
+ default:
+ BROWSER_LOGW("[%s:%d] Unknown rotationLock case!", __PRETTY_FUNCTION__,
+ __LINE__);
}
}
-void SimpleUI::downloadStarted(int status)
-{
+void SimpleUI::downloadStarted(int status) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- NotificationPopup *popup = NotificationPopup::createNotificationPopup(m_viewManager.getContent());
+ NotificationPopup *popup = NotificationPopup::createNotificationPopup(
+ m_viewManager.getContent());
- switch(status)
- {
- case DOWNLOAD_UNABLE_TO_DOWNLOAD:
- popup->show(_("IDS_BR_HEADER_UNABLE_TO_DOWNLOAD_ABB"), false);
- break;
- case DOWNLOAD_STARTING_DOWNLOAD:
- connection_type_e connection_type;
- connection_h handle;
+ switch (status) {
+ case DOWNLOAD_UNABLE_TO_DOWNLOAD:
+ popup->show(_("IDS_BR_HEADER_UNABLE_TO_DOWNLOAD_ABB"), false);
+ break;
+ case DOWNLOAD_STARTING_DOWNLOAD:
+ connection_type_e connection_type;
+ connection_h handle;
- if (connection_create(&handle) < 0) {
- BROWSER_LOGD("Fail to create network handle");
- }
- if (connection_get_type(handle, &connection_type) < 0) {
- BROWSER_LOGD("Fail to get download type");
- if (connection_destroy(handle) < 0) {
- BROWSER_LOGD("Fail to get download type");
- }
- }
+ if (connection_create(&handle) < 0) {
+ BROWSER_LOGD("Fail to create network handle");
+ }
+ if (connection_get_type(handle, &connection_type) < 0) {
+ BROWSER_LOGD("Fail to get download type");
+ if (connection_destroy(handle) < 0) {
+ BROWSER_LOGD("Fail to get download type");
+ }
+ }
- if (connection_type == CONNECTION_TYPE_BT){
- popup->show(_("IDS_BR_POP_STARTING_DOWNLOAD_ING"), _("Unable to use tethering."), false);
- }
- else{
- popup->show(_("IDS_BR_POP_STARTING_DOWNLOAD_ING"), false);
- }
+ if (connection_type == CONNECTION_TYPE_BT) {
+ popup->show(_("IDS_BR_POP_STARTING_DOWNLOAD_ING"), _("Unable to use tethering."), false);
+ } else {
+ popup->show(_("IDS_BR_POP_STARTING_DOWNLOAD_ING"), false);
+ }
- if (connection_destroy(handle) < 0) {
- BROWSER_LOGD("Fail to destroy network handle");
- }
- break;
- case DOWNLOAD_SAVEDPAGES:
- popup->show(_("IDS_BR_OPT_SAVEDPAGES"), false);
- break;
- case DOWNLOAD_FAIL:
- popup->show(_("IDS_BR_POP_FAIL"), false);
- break;
- case DOWNLOAD_ONLY_HTTP_OR_HTTPS_URLS:
- popup->show(_("IDS_BR_POP_ONLY_HTTP_OR_HTTPS_URLS_CAN_BE_DOWNLOADED"), false);
- break;
- default:
- break;
+ if (connection_destroy(handle) < 0) {
+ BROWSER_LOGD("Fail to destroy network handle");
+ }
+ break;
+ case DOWNLOAD_SAVEDPAGES:
+ popup->show(_("IDS_BR_OPT_SAVEDPAGES"), false);
+ break;
+ case DOWNLOAD_FAIL:
+ popup->show(_("IDS_BR_POP_FAIL"), false);
+ break;
+ case DOWNLOAD_ONLY_HTTP_OR_HTTPS_URLS:
+ popup->show(_("IDS_BR_POP_ONLY_HTTP_OR_HTTPS_URLS_CAN_BE_DOWNLOADED"),
+ false);
+ break;
+ default:
+ break;
}
popup->dismiss();
}
-void SimpleUI::loadStarted()
-{
+void SimpleUI::loadStarted() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_webPageUI->loadStarted();
if (m_findOnPageUI->isVisible())
m_splash_screen.hide();
}
-void SimpleUI::loadFinished()
-{
+void SimpleUI::loadFinished() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_webPageUI->loadFinished();
if (!m_webEngine->isSecretMode()) {
- m_tabService->updateTabItem(
- m_webEngine->currentTabId(),
- m_webEngine->getURI(),
- m_webEngine->getTitle(),
- m_webEngine->getOrigin());
- m_historyService->addHistoryItem(
- m_webEngine->getURI(),
- m_webEngine->getTitle(),
- m_webEngine->getFavicon());
+ m_tabService->updateTabItem(m_webEngine->currentTabId(),
+ m_webEngine->getURI(), m_webEngine->getTitle(),
+ m_webEngine->getOrigin());
+ m_historyService->addHistoryItem(m_webEngine->getURI(),
+ m_webEngine->getTitle(), m_webEngine->getFavicon());
}
}
-void SimpleUI::filterURL(const std::string& url)
-{
+void SimpleUI::filterURL(const std::string& url) {
BROWSER_LOGD("[%s:%d] url=%s", __PRETTY_FUNCTION__, __LINE__, url.c_str());
if (url == HomePageURL) {
m_webPageUI->getURIEntry().clearFocus();
}
-void SimpleUI::showFindOnPageUI(const std::string& str)
-{
+void SimpleUI::showFindOnPageUI(const std::string& str) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
assert(m_findOnPageUI.get());
m_findOnPageUI->show();
m_findOnPageUI->set_text(str.c_str());
}
-void SimpleUI::closeFindOnPageUI()
-{
+void SimpleUI::closeFindOnPageUI() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
assert(m_findOnPageUI.get());
assert(m_webEngine.get());
m_webEngine->setBarsShown(true);
}
-void SimpleUI::showTabUI()
-{
+void SimpleUI::showTabUI() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
pushViewToStack(m_tabUI);
- if (!m_webPageUI->stateEquals(WPUState::QUICK_ACCESS) &&
- m_webEngine->tabsCount() > 0 &&
- m_webEngine->isLoading())
+ if (!m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)
+ && m_webEngine->tabsCount() > 0 && m_webEngine->isLoading())
onGenerateThumb(m_webEngine->currentTabId());
}
m_tabUI->addTabItems(tabsContents, m_webEngine->isSecretMode());
}
-void SimpleUI::newTabClicked()
-{
+void SimpleUI::newTabClicked() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
showHomePage();
m_webPageUI->setShouldOpenNewTab(true);
}
-void SimpleUI::tabClicked(const tizen_browser::basic_webengine::TabId& tabId)
-{
+void SimpleUI::tabClicked(const tizen_browser::basic_webengine::TabId& tabId) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
switchToTab(tabId);
popStackTo(m_webPageUI);
}
-void SimpleUI::pwaPopupRequest()
-{
+void SimpleUI::pwaPopupRequest() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
TextPopup* popup = TextPopup::createPopup(m_viewManager.getContent());
popup->addButton(OK);
popup->addButton(CANCEL);
popup->addButton(NEVER);
popup->buttonClicked.connect(
- [this](const auto& button){ this->pwaPopupButtonClicked(button); });
+ [this](const auto& button) {this->pwaPopupButtonClicked(button);});
popup->setTitle(m_webEngine->getTitle());
popup->setMessage(_("IDS_BR_OPT_ADD_TO_HOME_SCREEN_ABB"));
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
-void SimpleUI::pwaPopupButtonClicked(const PopupButtons& button)
-{
+void SimpleUI::pwaPopupButtonClicked(const PopupButtons& button) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto uri = m_webEngine->getURI();
switch (button) {
- case OK:
- BROWSER_LOGD("[%s:%d] pwaPopup OK !", __PRETTY_FUNCTION__, __LINE__);
- m_webEngine->setPWAData();
- m_storageService->getPWAStorage().addPWAItem(uri, 1, 0);
- break;
- case CANCEL:
- BROWSER_LOGD("[%s:%d] pwaPopup DENY !", __PRETTY_FUNCTION__, __LINE__);
- m_storageService->getPWAStorage().addPWAItem(uri, 0, 0);
- break;
- case NEVER:
- BROWSER_LOGD("[%s:%d] pwaPopup NEVER !", __PRETTY_FUNCTION__, __LINE__);
- m_storageService->getPWAStorage().addPWAItem(uri, 0, 1);
- break;
- default:
- BROWSER_LOGW("[%s:%d] Unknown button type!", __PRETTY_FUNCTION__, __LINE__);
+ case OK:
+ BROWSER_LOGD("[%s:%d] pwaPopup OK !", __PRETTY_FUNCTION__, __LINE__);
+ m_webEngine->setPWAData();
+ m_storageService->getPWAStorage().addPWAItem(uri, 1, 0);
+ break;
+ case CANCEL:
+ BROWSER_LOGD("[%s:%d] pwaPopup DENY !", __PRETTY_FUNCTION__, __LINE__);
+ m_storageService->getPWAStorage().addPWAItem(uri, 0, 0);
+ break;
+ case NEVER:
+ BROWSER_LOGD("[%s:%d] pwaPopup NEVER !", __PRETTY_FUNCTION__, __LINE__);
+ m_storageService->getPWAStorage().addPWAItem(uri, 0, 1);
+ break;
+ default:
+ BROWSER_LOGW("[%s:%d] Unknown button type!", __PRETTY_FUNCTION__,
+ __LINE__);
}
}
-void SimpleUI::handleConfirmationRequest(basic_webengine::WebConfirmationPtr webConfirmation)
-{
+void SimpleUI::handleConfirmationRequest(
+ basic_webengine::WebConfirmationPtr webConfirmation) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- if (webConfirmation->getConfirmationType() == basic_webengine::WebConfirmation::ConfirmationType::CertificateConfirmation) {
+ if (webConfirmation->getConfirmationType()
+ == basic_webengine::WebConfirmation::ConfirmationType::CertificateConfirmation) {
if (m_webPageUI->stateEquals(WPUState::MAIN_WEB_PAGE)) {
- auto cert = std::dynamic_pointer_cast<basic_webengine::CertificateConfirmation, basic_webengine::WebConfirmation>(webConfirmation);
- auto type = m_certificateContents->isCertExistForHost(cert->getURI());
+ auto cert = std::dynamic_pointer_cast<
+ basic_webengine::CertificateConfirmation,
+ basic_webengine::WebConfirmation>(webConfirmation);
+ auto type = m_certificateContents->isCertExistForHost(
+ cert->getURI());
if (type == services::CertificateContents::UNSECURE_HOST_ALLOWED) {
- webConfirmation->setResult(tizen_browser::basic_webengine::WebConfirmation::ConfirmationResult::Confirmed);
+ webConfirmation->setResult(
+ tizen_browser::basic_webengine::WebConfirmation::ConfirmationResult::Confirmed);
m_webEngine->confirmationResult(webConfirmation);
} else {
m_webPageUI->getURIEntry().changeUri(webConfirmation->getURI());
- TextPopup* popup = TextPopup::createPopup(m_viewManager.getContent());
+ TextPopup* popup = TextPopup::createPopup(
+ m_viewManager.getContent());
popup->addButton(BACK_TO_SAFETY, true, true);
popup->addButton(VIEW_CERTIFICATE, false);
popup->addButton(CONTINUE);
auto popupData = std::make_shared<CertificatePopupData>();
popupData->cert = cert;
- popup->buttonClicked.connect(
- [=](const auto& button) mutable {
- this->certPopupButtonClicked(button, popupData);
+ popup->buttonClicked.connect([=](const auto& button) mutable {
+ this->certPopupButtonClicked(button, popupData);
});
popup->setTitle(_("IDS_BR_HEADER_SITE_NOT_TRUSTED_ABB"));
- popup->setMessage(_("IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"));
+ popup->setMessage(
+ _("IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"));
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
}
} else {
- BROWSER_LOGW("[%s:%d] Unknown WebConfirmation::ConfirmationType!", __PRETTY_FUNCTION__, __LINE__);
+ BROWSER_LOGW("[%s:%d] Unknown WebConfirmation::ConfirmationType!",
+ __PRETTY_FUNCTION__, __LINE__);
}
}
-void SimpleUI::showCertificatePopup()
-{
+void SimpleUI::showCertificatePopup() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
std::string uri = tools::extractDomain(m_webEngine->getURI());
- services::CertificateContents::HOST_TYPE type = m_certificateContents->isCertExistForHost(uri);
- std::string pem = m_storageService->getCertificateStorage().getPemForURI(uri);
+ services::CertificateContents::HOST_TYPE type =
+ m_certificateContents->isCertExistForHost(uri);
+ std::string pem = m_storageService->getCertificateStorage().getPemForURI(
+ uri);
showCertificatePopup(uri, pem, type);
}
-void SimpleUI::showUnsecureConnectionPopup()
-{
+void SimpleUI::showUnsecureConnectionPopup() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
TextPopup* popup = TextPopup::createPopup(m_viewManager.getContent());
popup->addButton(OK);
popup->setTitle("Unsecure connection!");
- popup->setMessage("The page which you're trying to open cannot be displayed, unsecure connection detected.");
+ popup->setMessage(
+ "The page which you're trying to open cannot be displayed, unsecure connection detected.");
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
-void SimpleUI::showCertificatePopup(const std::string& host, const std::string& pem, services::CertificateContents::HOST_TYPE type)
-{
+void SimpleUI::showCertificatePopup(const std::string& host,
+ const std::string& pem,
+ services::CertificateContents::HOST_TYPE type) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto popup = ContentPopup::createPopup(m_viewManager.getContent());
- popup->isLandscape.connect(
- [this]{ return this->isLandscape(); });
+ popup->isLandscape.connect([this] {return this->isLandscape();});
m_certificateContents->initUI(popup->getMainLayout());
m_certificateContents->setCurrentTabCertData(host, pem, type);
popup->setContent(m_certificateContents->getContent());
popup->addButton(OK);
popup->setTitle(_("IDS_BR_HEADER_SECURITY_CERTIFICATE"));
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
-void SimpleUI::certPopupButtonClicked(PopupButtons button, std::shared_ptr<PopupData> popupData)
-{
+void SimpleUI::certPopupButtonClicked(PopupButtons button,
+ std::shared_ptr<PopupData> popupData) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- std::shared_ptr<CertificatePopupData> certPopupData = std::dynamic_pointer_cast<CertificatePopupData, PopupData>(popupData);
+ std::shared_ptr < CertificatePopupData > certPopupData =
+ std::dynamic_pointer_cast<CertificatePopupData, PopupData>(
+ popupData);
switch (button) {
- case OK:
- break;
- case CONTINUE:
- {
- certPopupData->cert->setResult(basic_webengine::WebConfirmation::ConfirmationResult::Confirmed);
- m_webEngine->confirmationResult(certPopupData->cert);
- std::string uri = certPopupData->cert->getURI();
- std::string pem = certPopupData->cert->getPem();
- m_certificateContents->saveWrongCertificateInfo(uri, pem);
- break;
- }
- case BACK_TO_SAFETY:
- certPopupData->cert->setResult(basic_webengine::WebConfirmation::ConfirmationResult::Rejected);
- m_webEngine->confirmationResult(certPopupData->cert);
- break;
- case VIEW_CERTIFICATE:
- {
- showCertificatePopup(certPopupData->cert->getURI(), certPopupData->cert->getPem(), services::CertificateContents::UNSECURE_HOST_UNKNOWN);
- break;
- }
- default:
- BROWSER_LOGW("[%s:%d] Unknown button type!", __PRETTY_FUNCTION__, __LINE__);
+ case OK:
+ break;
+ case CONTINUE: {
+ certPopupData->cert->setResult(
+ basic_webengine::WebConfirmation::ConfirmationResult::Confirmed);
+ m_webEngine->confirmationResult(certPopupData->cert);
+ std::string uri = certPopupData->cert->getURI();
+ std::string pem = certPopupData->cert->getPem();
+ m_certificateContents->saveWrongCertificateInfo(uri, pem);
+ break;
+ }
+ case BACK_TO_SAFETY:
+ certPopupData->cert->setResult(
+ basic_webengine::WebConfirmation::ConfirmationResult::Rejected);
+ m_webEngine->confirmationResult(certPopupData->cert);
+ break;
+ case VIEW_CERTIFICATE: {
+ showCertificatePopup(certPopupData->cert->getURI(),
+ certPopupData->cert->getPem(),
+ services::CertificateContents::UNSECURE_HOST_UNKNOWN);
+ break;
+ }
+ default:
+ BROWSER_LOGW("[%s:%d] Unknown button type!", __PRETTY_FUNCTION__, __LINE__);
}
}
-Evas_Object* SimpleUI::showHistoryUI(Evas_Object* parent, SharedNaviframeWrapper naviframe, bool removeMode)
-{
+Evas_Object* SimpleUI::showHistoryUI(Evas_Object* parent,
+ SharedNaviframeWrapper naviframe, bool removeMode) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_historyUI->setNaviframe(naviframe);
auto ret = m_historyUI->createDaysList(parent, removeMode);
- m_historyUI->addHistoryItems(
- m_historyService->getHistoryToday(), HistoryPeriod::HISTORY_TODAY);
- m_historyUI->addHistoryItems(
- m_historyService->getHistoryYesterday(), HistoryPeriod::HISTORY_YESTERDAY);
- m_historyUI->addHistoryItems(
- m_historyService->getHistoryLastWeek(), HistoryPeriod::HISTORY_LASTWEEK);
- m_historyUI->addHistoryItems(
- m_historyService->getHistoryLastMonth(), HistoryPeriod::HISTORY_LASTMONTH);
- m_historyUI->addHistoryItems(
- m_historyService->getHistoryOlder(), HistoryPeriod::HISTORY_OLDER);
+ m_historyUI->addHistoryItems(m_historyService->getHistoryToday(),
+ HistoryPeriod::HISTORY_TODAY);
+ m_historyUI->addHistoryItems(m_historyService->getHistoryYesterday(),
+ HistoryPeriod::HISTORY_YESTERDAY);
+ m_historyUI->addHistoryItems(m_historyService->getHistoryLastWeek(),
+ HistoryPeriod::HISTORY_LASTWEEK);
+ m_historyUI->addHistoryItems(m_historyService->getHistoryLastMonth(),
+ HistoryPeriod::HISTORY_LASTMONTH);
+ m_historyUI->addHistoryItems(m_historyService->getHistoryOlder(),
+ HistoryPeriod::HISTORY_OLDER);
return ret;
}
-void SimpleUI::showSettings(unsigned s)
-{
+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_settingsUI = m_settingsManager->getView(
+ static_cast<SettingsMainOptions>(s));
pushViewToStack(m_settingsUI);
}
-void SimpleUI::onDefSearchEngineClicked()
-{
+void SimpleUI::onDefSearchEngineClicked() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto popup = RadioPopup::createPopup(m_viewManager.getContent());
- popup->setTitle(_(Translations::instance().SettingsDefaultSearchEngineTitle.c_str()));
+ popup->setTitle(
+ _(
+ Translations::instance().SettingsDefaultSearchEngineTitle.c_str()));
popup->addRadio(RadioButtons::GOOGLE);
popup->addRadio(RadioButtons::YAHOO);
popup->addRadio(RadioButtons::BING);
- auto stateString = [] {
- auto sig =
- SPSC.getWebEngineSettingsParamString(
- basic_webengine::WebEngineSettings::DEFAULT_SEARCH_ENGINE);
- return (sig && !sig->empty()) ?
- *sig :
- Translations::instance().Google;
- }();
+ auto stateString =
+ [] {
+ auto sig =
+ SPSC.getWebEngineSettingsParamString(
+ basic_webengine::WebEngineSettings::DEFAULT_SEARCH_ENGINE);
+ return (sig && !sig->empty()) ?
+ *sig :
+ Translations::instance().Google;
+ }();
auto state = RadioPopup::translateButtonState(stateString);
popup->setState(state);
- popup->radioButtonClicked.connect(
- [&,this](const RadioButtons& button){
+ popup->radioButtonClicked.connect([&, this](const RadioButtons& button) {
SPSC.setSearchEngineSubText(
- static_cast<int>(button));
+ static_cast<int>(button));
dismissPopup(popup);
});
- popup->popupShown.connect([this](const auto& popup){ this->showPopup(popup); });
+ popup->popupShown.connect(
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
-void SimpleUI::onSaveContentToClicked()
-{
+void SimpleUI::onSaveContentToClicked() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto popup = RadioPopup::createPopup(m_viewManager.getContent());
SPSC.settingsSaveContentRadioPopupPtr(popup);
- popup->setTitle(_(Translations::instance().SettingsAdvancedSaveContentTitle.c_str()));
+ popup->setTitle(
+ _(Translations::instance().SettingsAdvancedSaveContentTitle.c_str()));
popup->addRadio(RadioButtons::DEVICE);
popup->addRadio(RadioButtons::SD_CARD);
- auto stateString = []() -> std::string {
- auto sig =
- SPSC.getWebEngineSettingsParamString(
- basic_webengine::WebEngineSettings::SAVE_CONTENT_LOCATION);
- return (sig && !sig->empty()) ?
- *sig :
- Translations::instance().Device;
- }();
+ auto stateString =
+ []() -> std::string {
+ auto sig =
+ SPSC.getWebEngineSettingsParamString(
+ basic_webengine::WebEngineSettings::SAVE_CONTENT_LOCATION);
+ return (sig && !sig->empty()) ?
+ *sig :
+ Translations::instance().Device;
+ }();
auto state = RadioPopup::translateButtonState(stateString);
popup->setState(state);
- popup->radioButtonClicked.connect(
- [&,this](const RadioButtons& button){
+ popup->radioButtonClicked.connect([&, this](const RadioButtons& button) {
SPSC.setContentDestination(static_cast<int>(button));
dismissPopup(popup);
SPSC.settingsSaveContentRadioPopupPtr(nullptr);
});
- popup->popupShown.connect([this](const auto& popup){ this->showPopup(popup); });
+ popup->popupShown.connect(
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
-void SimpleUI::selectSettingsOtherPageChange()
-{
+void SimpleUI::selectSettingsOtherPageChange() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto popup = InputPopup::createPopup(m_viewManager.getContent());
popup->setTitle(_("IDS_BR_MBODY_SET_HOMEPAGE"));
popup->setOkButtonText(_("IDS_BR_BUTTON_SET"));
popup->setTip(_("IDS_BR_BODY_WEB_ADDRESS"));
popup->button_clicked.connect(
- [this](const std::string& otherPage){
- if (!otherPage.empty()) {
- SPSC.setWebEngineSettingsParamString(
- basic_webengine::WebEngineSettings::CURRENT_HOME_PAGE,
- otherPage);
- m_settingsUI->updateButtonMap();
- }
+ [this](const std::string& otherPage) {
+ if (!otherPage.empty()) {
+ SPSC.setWebEngineSettingsParamString(
+ basic_webengine::WebEngineSettings::CURRENT_HOME_PAGE,
+ otherPage);
+ m_settingsUI->updateButtonMap();
+ }
+ });
+ popup->popupShown.connect(
+ [this](const auto& popup) {this->showPopup(popup);});
+ popup->popupDismissed.connect([this](interfaces::AbstractPopup* popup) {
+ dismissPopup(popup);
+ m_settingsUI->updateButtonMap();
});
- popup->popupShown.connect([this](const auto& popup){ this->showPopup(popup); });
- popup->popupDismissed.connect(
- [this](interfaces::AbstractPopup* popup){
- dismissPopup(popup);
- m_settingsUI->updateButtonMap();
- }
- );
popup->show();
}
-void SimpleUI::switchToMobileMode()
-{
+void SimpleUI::switchToMobileMode() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (!m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)) {
m_webEngine->switchToMobileMode();
}
}
-void SimpleUI::switchToDesktopMode()
-{
+void SimpleUI::switchToDesktopMode() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (!m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)) {
m_webEngine->switchToDesktopMode();
}
}
-void SimpleUI::showBookmarkFlowUI()
-{
+void SimpleUI::showBookmarkFlowUI() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
std::string uri = m_webEngine->getURI();
m_bookmarkFlowUI->setURL(uri);
tizen_browser::services::BookmarkItem bookmarkItem;
m_favoriteService->getItem(uri, &bookmarkItem);
m_bookmarkFlowUI->setTitle(bookmarkItem.getTitle());
- m_bookmarkFlowUI->setFolder(m_favoriteService->getBookmarkItem(bookmarkItem.getParent()));
+ m_bookmarkFlowUI->setFolder(
+ m_favoriteService->getBookmarkItem(bookmarkItem.getParent()));
} else {
m_bookmarkFlowUI->setTitle(m_webEngine->getTitle());
m_bookmarkFlowUI->setFolder(m_favoriteService->getRoot());
pushViewToStack(m_bookmarkFlowUI);
}
-void SimpleUI::showBookmarkManagerUI(std::shared_ptr<services::BookmarkItem> parent,
- BookmarkManagerState state)
-{
+void SimpleUI::showBookmarkManagerUI(
+ std::shared_ptr<services::BookmarkItem> parent,
+ BookmarkManagerState state) {
BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__);
m_bookmarkManagerUI->setState(state);
pushViewToStack(m_bookmarkManagerUI);
m_bookmarkManagerUI->addBookmarkItems(parent,
- m_favoriteService->getAllBookmarkItems(parent->getId()));
+ m_favoriteService->getAllBookmarkItems(parent->getId()));
}
-void SimpleUI::showHomePage()
-{
+void SimpleUI::showHomePage() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
auto sig =
- SettingsPrettySignalConnector::Instance().
- getWebEngineSettingsParamString(
- basic_webengine::WebEngineSettings::CURRENT_HOME_PAGE);
- auto stateString = (sig && !sig->empty()) ?
- *sig :
- SettingsHomePage::DEF_HOME_PAGE;
+ SettingsPrettySignalConnector::Instance().getWebEngineSettingsParamString(
+ basic_webengine::WebEngineSettings::CURRENT_HOME_PAGE);
+ auto stateString =
+ (sig && !sig->empty()) ?
+ *sig :
+ SettingsHomePage::DEF_HOME_PAGE;
auto it = stateString.find(Translations::instance().CurrentPage);
if (!stateString.compare(Translations::instance().QuickPage.c_str())) {
switchViewToQuickAccess();
m_quickAccess->showQuickAccess();
return;
- } else if (!stateString.compare(Translations::instance().MostVisitedPage.c_str())) {
+ } else if (!stateString.compare(
+ Translations::instance().MostVisitedPage.c_str())) {
switchViewToQuickAccess();
m_quickAccess->showMostVisited();
return;
openNewTab(url);
}
-void SimpleUI::settingsDeleteSelectedData(const std::map<int, bool>& options)
-{
+void SimpleUI::settingsDeleteSelectedData(const std::map<int, bool>& options) {
BROWSER_LOGD("[%s]: Deleting selected data", __func__);
assert(m_viewManager.get());
bool isSelected = false;
popup->addButton(OK);
popup->addButton(CANCEL);
popup->buttonClicked.connect(
- [&, this](const auto& button){ this->onDeleteSelectedDataButton(button, options); });
+ [&, this](const auto& button) {this->onDeleteSelectedDataButton(button, options);});
popup->setTitle("Delete");
popup->setMessage("The selected web browsing data will be deleted.");
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
}
-void SimpleUI::onDeleteSelectedDataButton(const PopupButtons& button, const std::map<int, bool>& options)
-{
+void SimpleUI::onDeleteSelectedDataButton(const PopupButtons& button,
+ const std::map<int, bool>& options) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (button == OK) {
- NotificationPopup *popup = NotificationPopup::createNotificationPopup(m_viewManager.getContent());
+ NotificationPopup *popup = NotificationPopup::createNotificationPopup(
+ m_viewManager.getContent());
popup->show("Delete Web Browsing Data");
for (auto& it : options) {
if (it.first == BROWSING_HISTORY && it.second) {
- BROWSER_LOGD("clear history" );
+ BROWSER_LOGD("clear history");
m_historyService->clearAllHistory();
m_storageService->getPWAStorage().deletePWAItems();
} else if (it.first == CACHE && it.second) {
}
}
-void SimpleUI::tabLimitPopupButtonClicked(PopupButtons button)
-{
+void SimpleUI::tabLimitPopupButtonClicked(PopupButtons button) {
BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__);
if (button == OK) {
- BROWSER_LOGD("[%s:%d] Closing oldest tab and opening requested", __PRETTY_FUNCTION__, __LINE__);
+ BROWSER_LOGD("[%s:%d] Closing oldest tab and opening requested",
+ __PRETTY_FUNCTION__, __LINE__);
if (m_tabUI->getPopupDecision())
- m_storageService->getSettingsStorage().setSettingsBool(TAB_LIMIT_DECISION, true);
+ m_storageService->getSettingsStorage().setSettingsBool(
+ TAB_LIMIT_DECISION, true);
closeOldestTab();
switchToTab(m_webEngine->openRequestedPage());
}
m_popupVector.front()->onBackPressed();
}
-std::string SimpleUI::createSearchQuery(const std::string& text)
-{
+std::string SimpleUI::createSearchQuery(const std::string& text) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- const std::string searchEngine = [this] {
- auto sig =
- SPSC.getWebEngineSettingsParamString(
- basic_webengine::WebEngineSettings::DEFAULT_SEARCH_ENGINE);
- return (sig && !sig->empty()) ?
- *sig :
- Translations::instance().Google;
- }();
+ const std::string searchEngine =
+ [this] {
+ auto sig =
+ SPSC.getWebEngineSettingsParamString(
+ basic_webengine::WebEngineSettings::DEFAULT_SEARCH_ENGINE);
+ return (sig && !sig->empty()) ?
+ *sig :
+ Translations::instance().Google;
+ }();
return SearchEngineTranslation::createSearchQuery(text, searchEngine);
}
-bool SimpleUI::checkIfCreate()
-{
+bool SimpleUI::checkIfCreate() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_webEngine->tabsCount() >= m_tabLimit) {
- if (m_storageService->getSettingsStorage().getSettingsBool(TAB_LIMIT_DECISION, false)) {
+ if (m_storageService->getSettingsStorage().getSettingsBool(
+ TAB_LIMIT_DECISION, false)) {
closeOldestTab();
return true;
}
- ContentPopup* popup = ContentPopup::createPopup(m_viewManager.getContent());
+ ContentPopup* popup = ContentPopup::createPopup(
+ m_viewManager.getContent());
popup->addButton(CANCEL);
popup->addButton(OK);
popup->buttonClicked.connect(
- [this](const auto& button){ this->tabLimitPopupButtonClicked(button); });
+ [this](const auto& button) {this->tabLimitPopupButtonClicked(button);});
popup->setTitle("IDS_BR_HEADER_COULDNT_OPEN_NEW_TAB_ABB");
popup->setContent(m_tabUI->getPopupContent(popup->getMainLayout()));
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
return false;
- } else
+ } else {
return true;
+ }
}
-void SimpleUI::updateView()
-{
+void SimpleUI::updateView() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
int tabs = m_webEngine->tabsCount();
m_webPageUI->setTabsNumber(tabs);
}
-void SimpleUI::changeEngineState()
-{
+void SimpleUI::changeEngineState() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_webEngine->changeState();
updateView();
}
-void SimpleUI::engineTabClosed(const basic_webengine::TabId& id)
-{
+void SimpleUI::engineTabClosed(const basic_webengine::TabId& id) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
m_tabService->removeTab(id);
m_webPageUI->setTabsNumber(tabs);
if (tabs == 0) {
m_webPageUI->switchViewToQuickAccess(m_quickAccess->getContent());
- } else
+ } else {
switchViewToWebPage();
+ }
}
-void SimpleUI::onFirstSecretMode()
-{
+void SimpleUI::onFirstSecretMode() {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
TextPopup* popup = TextPopup::createPopup(m_viewManager.getContent());
popup->addButton(OK);
popup->setTitle(_("IDS_BR_HEADER_DONT_USE_PASSWORD_ABB"));
- popup->setMessage(_("IDS_BR_POP_TO_PROTECT_YOUR_SECRET_MODE_DATA_CREATE_A_PASSWORD_IF_YOU_USE_SECRET_MODE_WITHOUT_CREATING_A_PASSWORD_MSG"));
+ popup->setMessage(
+ _(
+ "IDS_BR_POP_TO_PROTECT_YOUR_SECRET_MODE_DATA_CREATE_A_PASSWORD_IF_YOU_USE_SECRET_MODE_WITHOUT_CREATING_A_PASSWORD_MSG"));
popup->buttonClicked.connect(
- [this](const auto&){ m_tabUI->switchToSecretFirstTime(); });
+ [this](const auto&) {m_tabUI->switchToSecretFirstTime();});
popup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
popup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
popup->show();
}
-void SimpleUI::addBookmark(BookmarkUpdate bookmark_update)
-{
+void SimpleUI::addBookmark(BookmarkUpdate bookmark_update) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_favoriteService) {
if (m_webEngine && !m_webEngine->getURI().empty()) {
- const int THUMB_HEIGHT = boost::any_cast<int>(
- Config::getInstance().get(CONFIG_KEY::FAVORITESERVICE_THUMB_HEIGHT));
- const int THUMB_WIDTH = boost::any_cast<int>(
- Config::getInstance().get(CONFIG_KEY::FAVORITESERVICE_THUMB_WIDTH));
- m_favoriteService->addBookmark(m_webEngine->getURI(), bookmark_update.title, std::string(),
- m_webEngine->getSnapshotData(THUMB_WIDTH, THUMB_HEIGHT, tools::SnapshotType::ASYNC_BOOKMARK),
- m_webEngine->getFavicon(), bookmark_update.folder_id);
+ const int THUMB_HEIGHT =
+ boost::any_cast<int>(
+ Config::getInstance().get(
+ CONFIG_KEY::FAVORITESERVICE_THUMB_HEIGHT));
+ const int THUMB_WIDTH =
+ boost::any_cast<int>(
+ Config::getInstance().get(
+ CONFIG_KEY::FAVORITESERVICE_THUMB_WIDTH));
+ m_favoriteService->addBookmark(m_webEngine->getURI(),
+ bookmark_update.title, std::string(),
+ m_webEngine->getSnapshotData(THUMB_WIDTH,
+ THUMB_HEIGHT,
+ tools::SnapshotType::ASYNC_BOOKMARK),
+ m_webEngine->getFavicon(),
+ bookmark_update.folder_id);
}
}
}
-void SimpleUI::editBookmark(BookmarkUpdate bookmark_update)
-{
+void SimpleUI::editBookmark(BookmarkUpdate bookmark_update) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_favoriteService) {
if (m_webEngine && !bookmark_update.old_url.empty()) {
services::BookmarkItem oldItem;
m_favoriteService->getItem(bookmark_update.old_url, &oldItem);
- m_favoriteService->editBookmark(oldItem.getId(), bookmark_update.url,
- bookmark_update.title, bookmark_update.folder_id);
- m_bookmarkManagerUI->addBookmarkItems(nullptr, m_favoriteService->getAllBookmarkItems(
- bookmark_update.folder_id));
+ m_favoriteService->editBookmark(oldItem.getId(),
+ bookmark_update.url, bookmark_update.title,
+ bookmark_update.folder_id);
+ m_bookmarkManagerUI->addBookmarkItems(nullptr,
+ m_favoriteService->getAllBookmarkItems(
+ bookmark_update.folder_id));
}
}
}
-void SimpleUI::deleteBookmark()
-{
+void SimpleUI::deleteBookmark() {
std::string uri(m_webEngine->getURI());
bool ret(true);
if (m_favoriteService->bookmarkExists(uri))
ret = m_favoriteService->deleteBookmark(uri);
// TODO add translations
auto text(
- ret ?
- "Bookmark deletion has failed!" :
- "Bookmark has been deleted successfully.");
+ ret ? "Bookmark deletion has failed!" : "Bookmark has been deleted successfully.");
tools::EflTools::createToastPopup(text);
}
-void SimpleUI::settingsOverrideUseragent(const std::string& userAgent)
-{
+void SimpleUI::settingsOverrideUseragent(const std::string& userAgent) {
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
if (m_webPageUI->stateEquals(WPUState::QUICK_ACCESS)) {
- NotificationPopup *popup =
- NotificationPopup::createNotificationPopup(m_viewManager.getContent());
+ NotificationPopup *popup = NotificationPopup::createNotificationPopup(
+ m_viewManager.getContent());
popup->show("Open a webpage to perform this operation.");
popup->dismiss();
popTheStack();
}
if (userAgent.empty()) {
- auto inputPopup = InputPopup::createPopup(
- m_viewManager.getContent(),
- "Override UserAgent", "",
- "",
- _("IDS_BR_SK_DONE"),
- _("IDS_BR_SK_CANCEL_ABB"));
+ auto inputPopup = InputPopup::createPopup(m_viewManager.getContent(),
+ "Override UserAgent", "", "", _("IDS_BR_SK_DONE"),
+ _("IDS_BR_SK_CANCEL_ABB"));
inputPopup->button_clicked.connect(
- [this](const auto& ua){ this->onOverrideUseragentButton(ua); });
+ [this](const auto& ua) {this->onOverrideUseragentButton(ua);});
inputPopup->popupShown.connect(
- [this](const auto& popup){ this->showPopup(popup); });
+ [this](const auto& popup) {this->showPopup(popup);});
inputPopup->popupDismissed.connect(
- [this](const auto& popup){ this->dismissPopup(popup); });
+ [this](const auto& popup) {this->dismissPopup(popup);});
inputPopup->show();
- }
- else {
+ } else {
onOverrideUseragentButton(userAgent);
}
}
-void SimpleUI::onOverrideUseragentButton(const std::string& newUA)
-{
+void SimpleUI::onOverrideUseragentButton(const std::string& newUA) {
BROWSER_LOGD("[%s]: Overriding useragent", __func__);
- NotificationPopup *popup =
- NotificationPopup::createNotificationPopup(m_viewManager.getContent());
+ NotificationPopup *popup = NotificationPopup::createNotificationPopup(
+ m_viewManager.getContent());
m_webEngine->setUserAgent(newUA);
popup->show("UserAgent updated..");
popup->dismiss();