Fix prevent issue
[platform/framework/web/wrt.git] / src / wrt-client / wrt-client.cpp
index fea7ea0..188bf04 100644 (file)
@@ -33,7 +33,6 @@
 #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"
 
@@ -410,7 +409,6 @@ void WrtClient::launchStep()
     }
 
     setInitialViewMode();
-    PrepareExternalStorageSingleton::Instance().Initialize(m_dao->getTizenPkgId());
 
     /* remove language change callback */
     /*
@@ -470,6 +468,7 @@ void WrtClient::launchStep()
     m_windowData->init();
     m_windowData->postInit();
 
+#if X11
     // sub-mode support
     if (m_submodeSupport->isInlineMode()) {
         if (m_submodeSupport->transientWindow(
@@ -481,6 +480,7 @@ void WrtClient::launchStep()
             LogWarning("Fail to set submode");
         }
     }
+#endif
     m_windowData->smartCallbackAdd(Layer::FOCUS,
                                    "focused",
                                    focusedCallback,
@@ -719,6 +719,7 @@ void WrtClient::setCtxpopupItem(void)
 void WrtClient::ctxpopupShare(void)
 {
     LogDebug("share");
+#ifdef X11
     const char* url = ewk_view_url_get(m_widget->GetCurrentWebview());
     if (!url) {
         LogError("url is empty");
@@ -736,6 +737,7 @@ void WrtClient::ctxpopupShare(void)
             "delete,request",
             &WrtClient::ExitCallback,
             this);
+#endif
 }
 
 void WrtClient::ctxpopupReload(void)
@@ -747,6 +749,7 @@ 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");
@@ -760,6 +763,7 @@ void WrtClient::ctxpopupLaunchBrowser(void)
     } else {
         LogDebug("fail");
     }
+#endif
 }
 
 void WrtClient::hwkeyCallback(const std::string& key)
@@ -770,7 +774,9 @@ 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();
             }
@@ -782,7 +788,9 @@ void WrtClient::hwkeyCallback(const std::string& key)
         // 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());
             }
         }
     }
@@ -824,7 +832,6 @@ void WrtClient::shutdownStep()
                                        unfocusedCallback);
         m_widget.reset();
         ewk_context_delete(s_preparedEwkContext);
-        PrepareExternalStorageSingleton::Instance().Deinitialize();
         WRT::CoreModuleSingleton::Instance().Terminate();
     }
     if (m_initialized) {
@@ -1032,6 +1039,10 @@ int main(int argc,
             // 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);