#include <dpl/localization/w3c_file_localization.h>
#include <dpl/localization/LanguageTagsProvider.h>
#include <popup-runner/PopupInvoker.h>
-#include <prepare_external_storage.h>
#include <vconf.h>
#include "auto_rotation_support.h"
#include "client_command_line_parser.h"
#include "client_ide_support.h"
+#include "client_security_support.h"
#include "client_service_support.h"
#include "client_submode_support.h"
const std::string VIEWMODE_TYPE_MAXIMIZED = "maximized";
const std::string VIEWMODE_TYPE_WINDOWED = "windowed";
char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
-const char* const BUNDLE_PATH = "/usr/lib/libwrt-injected-bundle.so";
+const char* const BUNDLE_PATH = LIBDIR_PREFIX "/usr/lib/libwrt-injected-bundle.so";
const char* const MESSAGE_NAME_INITIALIZE = "ToInjectedBundle::INIT";
+const unsigned int UID_ROOT = 0;
// process pool
const char* const DUMMY_PROCESS_PATH = "/usr/bin/wrt_launchpad_daemon_candidate";
}
setInitialViewMode();
- PrepareExternalStorageSingleton::Instance().Initialize(m_dao->getTizenPkgId());
/* remove language change callback */
/*
m_windowData->init();
m_windowData->postInit();
+#if X11
// sub-mode support
if (m_submodeSupport->isInlineMode()) {
if (m_submodeSupport->transientWindow(
LogWarning("Fail to set submode");
}
}
+#endif
m_windowData->smartCallbackAdd(Layer::FOCUS,
"focused",
focusedCallback,
}
}
+void WrtClient::ExitCallback(void* data,
+ Evas_Object * /*obj*/,
+ void * /*event_info*/)
+{
+ LogInfo("ExitCallback");
+ Assert(data);
+
+ WrtClient* This = static_cast<WrtClient*>(data);
+
+ This->OnTerminate();
+}
+
void WrtClient::setCtxpopupItem(void)
{
WindowData::CtxpopupItemDataList data;
void WrtClient::ctxpopupShare(void)
{
LogDebug("share");
+#ifdef X11
const char* url = ewk_view_url_get(m_widget->GetCurrentWebview());
if (!url) {
LogError("url is empty");
} else {
LogDebug("fail");
}
+ evas_object_smart_callback_add(m_windowData->m_win,
+ "delete,request",
+ &WrtClient::ExitCallback,
+ this);
+#endif
}
void WrtClient::ctxpopupReload(void)
void WrtClient::ctxpopupLaunchBrowser(void)
{
LogDebug("launchBrowser");
+#ifdef X11
const char* url = ewk_view_url_get(m_widget->GetCurrentWebview());
if (!url) {
LogError("url is empty");
} else {
LogDebug("fail");
}
+#endif
}
void WrtClient::hwkeyCallback(const std::string& key)
// windowed UX - hosted application
if (key == KeyName::BACK) {
if (m_isWebkitFullscreen) {
- ewk_view_fullscreen_exit(m_widget->GetCurrentWebview());
+ // FIXME!!! This method has not yet landed in the tizen 3.0
+ // webkit-efl source tree
+ //ewk_view_fullscreen_exit(m_widget->GetCurrentWebview());
} else {
m_widget->Backward();
}
// packaged application
if (key == KeyName::BACK) {
if (m_isFullscreenByPlatform) {
- ewk_view_fullscreen_exit(m_widget->GetCurrentWebview());
+ // FIXME!!! This method has not yet landed in the tizen 3.0
+ // webkit-efl source tree
+ //ewk_view_fullscreen_exit(m_widget->GetCurrentWebview());
}
}
}
unfocusedCallback);
m_widget.reset();
ewk_context_delete(s_preparedEwkContext);
- PrepareExternalStorageSingleton::Instance().Deinitialize();
WRT::CoreModuleSingleton::Instance().Terminate();
}
if (m_initialized) {
{
int fd = ecore_main_fd_handler_fd_get(handler);
+ if (fd == -1)
+ {
+ LogDebug("ECORE_FD_GET");
+ exit(-1);
+ }
+
if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR))
{
LogDebug("ECORE_FD_ERROR");
-
- if (fd != -1)
- {
- close(fd);
- }
-
+ close(fd);
exit(-1);
- return ECORE_CALLBACK_CANCEL;
}
if (ecore_main_fd_handler_active_get(handler, ECORE_FD_READ))
memset(pkt, 0, AUL_SOCK_MAXBUFF);
int recv_ret = recv(fd, pkt, AUL_SOCK_MAXBUFF, 0);
-
- if (fd != -1)
- {
- close(fd);
- }
+ close(fd);
if (recv_ret == -1)
{
LogDebug("recv error!");
+ free(pkt);
exit(-1);
}
- LogDebug("recv_ret : " << recv_ret << ", pkt->len : " << pkt->len);
+ LogDebug("recv_ret : " << recv_ret << ", pkt->len : " << pkt->len);
ecore_main_fd_handler_del(handler);
-
process_pool_launchpad_main_loop(pkt, app_argv[0], &app_argc, &app_argv);
-
free(pkt);
}
-
ecore_main_loop_quit();
- return ECORE_CALLBACK_CANCEL;
}
return ECORE_CALLBACK_CANCEL;
app_argc = argc;
app_argv = argv;
+#ifndef X11
+ // Mesa does a bad job detecting the correct EGL
+ // platform to use, and ends up assuming that the
+ // wrt-client is using X
+ setenv("EGL_PLATFORM", "wayland", 1);
+#endif
+
UNHANDLED_EXCEPTION_HANDLER_BEGIN
{
ADD_PROFILING_POINT("main-entered", "point");
// This change is needed for getting elementary profile
// /opt/home/app/.elementary/config/mobile/base.cfg
const char* backupEnv = getenv(HOME);
+ if (!backupEnv) {
+ // If getenv return "NULL", set empty string
+ backupEnv = "";
+ }
setenv(HOME, APP_HOME_PATH, 1);
LogDebug("elm_init()");
elm_init(argc, argv);
ClientModule::CommandLineParser::getTizenId(argc, argv);
if (!tizenId.empty()) {
+ if (UID_ROOT == getuid()) {
+ // Drop root permission
+ // Only launch web application by console command case has root permission
+ if (!ClientModule::SecuritySupport::setAppPrivilege(tizenId)) {
+ LogError("Fail to set app privilege : [" << tizenId << "]");
+ exit(-1);
+ }
+ }
+
LogDebug("Launching by fork mode");
// Language env setup
appcore_set_i18n("wrt-client", NULL);