Merge branch working into tizen
authorHoseon LEE <hoseon46.lee@samsung.com>
Sun, 29 Sep 2013 07:11:47 +0000 (16:11 +0900)
committerHoseon LEE <hoseon46.lee@samsung.com>
Sun, 29 Sep 2013 07:17:25 +0000 (16:17 +0900)
Conflicts:
CMakeLists.txt
packaging/wrt.spec
src/view/common/application_launcher.cpp
src/view/common/scheme_action_map_data.h
src/view/webkit/ewk_context_manager.cpp
src/view/webkit/injected-bundle/CMakeLists.txt
src/view/webkit/injected-bundle/wrt-injected-bundle.cpp
src/view/webkit/view_logic_service_support.cpp
src/wrt-client/window_data.cpp
src/wrt-client/wrt-client.cpp
src/wrt-client/wrt-client.h
src/wrt-launcher/wrt-launcher.cpp
src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt

Change-Id: I34297e3a0e893eb64f0b62a776aa21f8b51ed930

15 files changed:
1  2 
CMakeLists.txt
packaging/wrt.spec
src/CMakeLists.txt
src/api_new/CMakeLists.txt
src/plugin-service/CMakeLists.txt
src/view/common/scheme_action_map_data.h
src/view/webkit/ewk_context_manager.cpp
src/view/webkit/injected-bundle/CMakeLists.txt
src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp
src/wrt-client/window_data.cpp
src/wrt-client/wrt-client.cpp
src/wrt-client/wrt-client.h
src/wrt-launchpad-daemon/CMakeLists.txt
src/wrt-launchpad-daemon/include/launchpad_util.h
systemd/wrt_launchpad_daemon@.service

diff --cc CMakeLists.txt
@@@ -46,24 -46,6 +46,22 @@@ OPTION(CSP_SUPPORT "Support for csp pol
  OPTION(ALLOW_NAVIGATION_SUPPORT "Support for allow-navigation" ON)
  OPTION(APP_SCHEME_SUPPORT "Support for app:// scheme" OFF)
  OPTION(CORS_WHITELISTING_SUPPORT "CORS white listing for access positions" OFF)
- OPTION(MULTIPROCESS_SERVICE_SUPPORT "Process per service" OFF)
- OPTION(MULTIPROCESS_SERVICE_SUPPORT_INLINE "Process per service - inline mode support" OFF)
 +OPTION(DECRYPT_SUPPORT "Enable appmanager capabilities" ON)
 +OPTION(MULTI_USER_SUPPORT "Enable multi-user support" OFF)
 +
 +IF(MULTI_USER_SUPPORT)
 +    ADD_DEFINITIONS("-DMULTI_USER_SUPPORT")
 +ELSE()
 +      ADD_DEFINITIONS("-DDAC_ACTIVATE")
 +ENDIF(MULTI_USER_SUPPORT)
 +
 +IF(DECRYPT_SUPPORT)
 +    ADD_DEFINITIONS("-DDECRYPT")
 +ENDIF(DECRYPT_SUPPORT)
 +OPTION(X11_SUPPORT "Enable X11" ON)
 +IF(X11_SUPPORT)
 +    ADD_DEFINITIONS("-DX11")
 +ENDIF(X11_SUPPORT)
  IF(CSP_SUPPORT)
      ADD_DEFINITIONS("-DCSP_ENABLED")
  ENDIF(CSP_SUPPORT)
@@@ -1,23 -1,12 +1,21 @@@
 -#git:framework/web/wrt
 +%bcond_with mesa
 +%bcond_with wayland
 +%bcond_with decrypt
 +%bcond_with multi_user
 +
  Name:       wrt
 -Summary:    web runtime
 +Summary:    Web runtime
- Version:    0.8.198.3
+ Version:    0.8.271
  Release:    1
  Group:      Development/Libraries
 -License:    Apache License, Version 2.0
 +License:    Apache-2.0
  URL:        N/A
  Source0:    %{name}-%{version}.tar.gz
- ### systemd service for mono-user mode
- Source101:  wrt_launchpad_daemon@.service
 +## wrt-launchpad-daemon #######################################################
 +### systemd service for multi-user mode
 +Source102:  wrt_launchpad_daemon_user.service
 +Source1001:   wrt.manifest
 +###############################################################################
  
  BuildRequires:  cmake
  BuildRequires:  gettext
@@@ -55,19 -45,12 +54,20 @@@ BuildRequires:  pkgconfig(wrt-popup-ace
  BuildRequires:  pkgconfig(sysman)
  BuildRequires:  pkgconfig(app2sd)
  BuildRequires:  pkgconfig(capi-system-system-settings)
- %if %{with decrypt}
- BuildRequires:  pkgconfig(osp-appfw)
- BuildRequires:  osp-appfw-internal-devel
- Requires: osp-appfw
- %endif
 +%if %{with mesa}
 +BuildRequires: pkgconfig(gl)
 +BuildRequires: pkgconfig(glesv2)
 +%else
 +BuildRequires: pkgconfig(gles20)
 +%endif
 +Requires(post): /sbin/ldconfig
 +Requires(postun): /sbin/ldconfig
+ BuildRequires:  pkgconfig(libsmack)
+ BuildRequires:  pkgconfig(efl-assist)
+ BuildRequires:  libss-client-devel
+ BuildRequires:  gettext
+ BuildRequires:  edje-tools
+ Requires: libss-client
  
  ## wrt-launchpad-daemon #######################################################
  BuildRequires:  pkgconfig(app-checker)
@@@ -101,32 -89,19 +107,38 @@@ cp %{SOURCE1001} 
  %endif
  
  %build
 -export LDFLAGS+="-Wl,--rpath=/usr/lib"
+ %if 0%{?tizen_build_binary_release_type_eng}
+ export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
+ export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
+ export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
+ %endif
 +export LDFLAGS+="-Wl,--rpath=%{_libdir}"
 +
 +%cmake . -DDPL_LOG="ON"       \
 +       -DPROJECT_VERSION=%{version} \
 +         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
 +%if %{with mesa}
 +        -DUSE_MESA=On \
 +%endif
 +%if %{with wayland}
 +         -DX11_SUPPORT=Off \
 +%else
 +         -DX11_SUPPORT=On \
 +%endif
 +%if %{with decrypt}
 +         -DDECRYPT_SUPPORT=On \
 +%else
 +         -DDECRYPT_SUPPORT=Off \
 +%endif
 +%if %{with multi_user}
 +         -DMULTI_USER_SUPPORT=On \
 +%else
 +         -DMULTI_USER_SUPPORT=Off \
 +%endif
  
 -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -        -DDPL_LOG="ON"                    \
 -        -DPROJECT_VERSION=%{version} \
 -        -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
          %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
 +
  make %{?jobs:-j%jobs}
  
  %install
@@@ -135,25 -111,13 +148,20 @@@ cp LICENSE.Flora %{buildroot}/usr/share
  %make_install
  
  ## wrt-launchpad-daemon #######################################################
- mkdir -p %{buildroot}/etc/init.d
- install -m 755 src/wrt-launchpad-daemon/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/init.d
- mkdir -p %{buildroot}/etc/rc.d/rc3.d
- mkdir -p %{buildroot}/etc/rc.d/rc4.d
- ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S15wrt_launchpad_run
- ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run
  
  #systemd
 +
 +%if %{with multi_user}
 +mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/
 +install -m 0644 %SOURCE102 %{buildroot}%{_unitdir_user}/wrt_launchpad_daemon.service
 +ln -s ../wrt_launchpad_daemon.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
 +%else
  mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
- install -m 0644 %SOURCE101 %{buildroot}%{_unitdir}/wrt_launchpad_daemon@.service
- ln -s ../wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
+ mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
+ ln -s %{_unitdir}/wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
+ ln -s %{_unitdir}/wrt_launchpad_daemon_1.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
+ ln -s %{_unitdir}/wrt_launchpad_daemon_2.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
 +%endif
  
  %preun
  if [ $1 == 0 ]; then
@@@ -229,17 -172,12 +235,17 @@@ systemctl daemon-reloa
  /etc/smack/accesses2.d/wrt_launchpad_daemon.rule
  /opt/etc/smack/accesses.d/wrt_launchpad_daemon.rule
  #systemd
 +%if %{with multi_user}
 +%{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
 +%{_unitdir_user}/wrt_launchpad_daemon.service
 +%else
  %{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
  %{_unitdir}/wrt_launchpad_daemon@.service
+ %{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
+ %{_unitdir}/wrt_launchpad_daemon_1.socket
+ %{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
+ %{_unitdir}/wrt_launchpad_daemon_2.socket
 +%endif
  ###############################################################################
  
  %files devel
@@@ -83,31 -109,8 +109,32 @@@ SET(SYS_WRT_BASIC_DE
      ui-gadget-1
      secure-storage
      app2sd
+     capi-appfw-app-manager
  )
 +ELSE(X11_SUPPORT)
 +SET(SYS_WRT_BASIC_DEP
 +    openssl
 +    libpcrecpp
 +    glib-2.0
 +    gthread-2.0
 +    libsoup-2.4
 +    libiri
 +    appsvc
 +    cert-svc-vcore
 +    edje
 +    ecore
 +    ecore-wayland
 +    evas
 +    eina
 +    ewebkit2
 +    elementary
 +    vconf
 +    cert-svc
 +    ui-gadget-1
 +    secure-storage
 +    app2sd
 +)
 +ENDIF(X11_SUPPORT)
  
  IF(SMACK_ENABLED)
    LIST(APPEND SYS_WRT_BASIC_DEP libprivilege-control)
@@@ -55,8 -55,23 +55,23 @@@ SET(WRT_CORE_MODULE_INTERFACE_LIBRARIE
      ${SYS_CORE_MODULE_DEP_LIBRARIES}
  )
  
+ TARGET_LINK_LIBRARIES(${TARGET_CORE_MODULE_LIB}
+ # include all symbols that could be used by wrt-client or other binaries
+     "-Wl,--whole-archive"
+     ${TARGET_WRT_ENGINE_STATIC}
+     ${TARGET_VIEW_COMMON_LIB_STATIC}
+     "-Wl,--no-whole-archive"
+     ${TARGET_VIEW_MODULE_LIB}
+     ${WRT_CORE_MODULE_INTERFACE_LIBRARIES}
+ )
+ SET_TARGET_PROPERTIES(${TARGET_CORE_MODULE_LIB}
+     PROPERTIES
+     LINK_INTERFACE_LIBRARIES "${WRT_CORE_MODULE_INTERFACE_LIBRARIES}"
+ )
  INSTALL(TARGETS ${TARGET_CORE_MODULE_LIB}
 -    DESTINATION lib/
 +    DESTINATION ${LIB_INSTALL_DIR}/
      PERMISSIONS OWNER_READ OWNER_WRITE
      GROUP_READ GROUP_EXECUTE WORLD_READ
  )
Simple merge
@@@ -44,15 -44,9 +44,9 @@@ enum UriAction 
   *           value "_new" is also treated this way). Tizen won't satisfy this
   *           requirement. It should open new windows in WRT.
   *
-  * Multiview - Not supported in WAC application. Therefore opening WIDGET scheme
-  *           in new window will result in launching appssvc, which won't be able
-  *           to handle it. The correct behaviour has to be defined. In case of
-  *           Tizen, new window will be opened in WRT.
-  *
 - * Video - YOUTUBE and RSTP are handled by video player.
 + * Video - RSTP is handled by video player.
   *
-  * File scheme - FILE scheme has to be handled by WRT with exception to new
-  *           window in WAC application (no support for multiple views)
+  * File scheme - FILE scheme has to be handled by WRT
   *
   * WS-1510/20/30/40/50 - All remaining cases are always handled by appsvc
   */
  #include <dpl/utils/wrt_global_settings.h>
  #include "ewk_context_manager.h"
  
- namespace WRT {
- static const std::string bundlePath( LIBDIR_PREFIX "/libwrt-injected-bundle.so");
- static const std::string caCertPath("/opt/usr/share/certs/ca-certificate.crt");
- #ifdef __arm__
- const std::string plugins_arch = "plugins/arm";
- #else
- const std::string plugins_arch = "plugins/x86";
- #endif
+ namespace ViewModule {
+ namespace {
 -const std::string bundlePath("/usr/lib/libwrt-injected-bundle.so");
++const std::string bundlePath( LIBDIR_PREFIX "/libwrt-injected-bundle.so");
+ std::map<Ewk_Extensible_API, Eina_Bool> defaultExtensibleAPI = {
+     { EWK_EXTENSIBLE_API_MEDIA_STREAM_RECORD,       EINA_TRUE  },
+     { EWK_EXTENSIBLE_API_ROTATE_CAMERA_VIEW,        EINA_FALSE },
+     { EWK_EXTENSIBLE_API_MEDIA_VOLUME_CONTROL,      EINA_TRUE  },
+ };
+ } // anonymous namespace
  
  EwkContextManager::EwkContextManager(
          const std::string& tizenAppId,
@@@ -30,24 -28,10 +29,24 @@@ PKG_CHECK_MODULES(INJECTED_BUNDLE_DE
      libprivilege-control
      libiri
      libpcrecpp
+     wrt-plugins-ipc-message
+     wrt-dispatch-event
      REQUIRED
  )
 +ELSE(DECRYPT_SUPPORT)
 +PKG_CHECK_MODULES(INJECTED_BUNDLE_DEP
 +    dpl-efl
 +    dpl-utils-efl
 +    dpl-wrt-dao-ro
 +    dpl-encryption
 +    ewebkit2
 +    vconf
 +    libprivilege-control
 +    libiri
 +    libpcrecpp
 +    REQUIRED
 +)
 +ENDIF(DECRYPT_SUPPORT)
  
  SET(INJECTED_BUNDLE_SOURCES
      ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp
@@@ -117,21 -117,14 +117,20 @@@ bool checkWhitelist(const char *url
          return true;
      }
  
 -    DPL::ScopedPtr<iri_t> iri(iri_parse(url));
 +    iri_t* iri = iri_parse(url);
 +    if (!iri)
 +        return false;
 +
      if (!iri->scheme || !iri->host || strlen(iri->host) == 0) {
 +        iri_destroy(iri);
          return true;
      }
 +
      std::string scheme = iri->scheme;
      std::string host = iri->host;
 +    iri_destroy(iri);
  
      if (scheme.find(SCHEME_TYPE_HTTP) == std::string::npos) {
-         LogDebug("url doesn't need to check white list");
          return true;
      }
  
  
  #include <ui-gadget.h>
  #include <dpl/log/log.h>
+ #include <dpl/foreach.h>
+ #include <efl_assist_screen_reader.h>
  
 +#ifndef X11
 +#include <Ecore_Wayland.h>
 +#endif
 +
  namespace {
- char const* const PLATFORM_EDJ_PATH = "/usr/share/edje/wrt/Platform.edj";
- char const* const DAEMON_EDJ_PATH = "/usr/share/edje/wrt/Daemon.edj";
- char const* const THEME_EDJ_PATH = "/usr/share/edje/wrt/wrt_theme.edj";
- char const* const ELM_STATE_SHOW_CONTENT = "elm,state,show,content";
- char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
- char const* const ELM_SWALLOW_BACKWARD = "elm.swallow.backward";
- const char *ELM_EVENT_PROFILE_CHANGED = "profile,changed";
- char const* const ELM = "elm";
- char const* const LAYOUT = "layout";
- char const* const APPLICATION = "application";
- char const* const INDICATOR = "indicator";
- char const* const NOINDICATOR = "noindicator";
- char const* const INTERNAL_LAYOUT = "internal_layout";
- char const* const FLOATBACKWARD_BUTTON_STYLE = "wrt/backward";
+ const unsigned int UID_ROOT = 0;
+ const char* const DELETE_REQUEST = "delete,request";
+ const char* const PROFILE_CHANGED = "profile,changed";
+ const char* const DESKTOP_ICON_PATH =
+     "/opt/share/icons/default/small/tizenScmgz.png";
  const std::string DESKTOP_PROFILE("desktop");
+ const int PROGRESS_H = 10;
  } // anonymous namespace
  
  WindowData::WindowData(unsigned long pid, bool manualInit) :
@@@ -76,21 -70,20 +74,22 @@@ void WindowData::init(
          return;
      }
  
-     // import button theme
-     elm_theme_overlay_add(NULL, THEME_EDJ_PATH);
      m_conformant = createConformant(m_win);
      evas_object_show(m_conformant);
-     m_platform_layout = createPlatformLayout(m_conformant);
-     evas_object_show(m_platform_layout);
-     m_navigation = createNavigationBar(m_platform_layout);
-     evas_object_show(m_navigation);
-     m_user_layout = createUserLayout(m_navigation);
-     evas_object_show(m_user_layout);
+     m_topLayout = createTopLayout(m_conformant);
+     evas_object_show(m_topLayout);
+     m_naviframe = createNaviframe(m_topLayout);
+     evas_object_show(m_naviframe);
+     m_mainLayout = createMainLayout(m_naviframe);
+     evas_object_show(m_mainLayout);
+     m_focus = createFocus(m_mainLayout);
+     evas_object_show(m_focus);
+     m_progressbar = createProgressBar(m_win, m_mainLayout);
+     evas_object_show(m_progressbar);
  
 +#ifdef X11
      UG_INIT_EFL(m_win, UG_OPT_INDICATOR_ENABLE);
 +#endif
      m_initialized = true;
  }
  
@@@ -145,7 -219,7 +225,8 @@@ void WindowData::setEvasObjectData(Laye
  
  Evas_Object* WindowData::createWindow(unsigned long pid)
  {
 +    int w, h;
+     elm_config_preferred_engine_set("opengl_x11");
      ADD_PROFILING_POINT("elm_win_add", "start");
      Evas_Object* window = elm_win_add(NULL, "wrt-widget", ELM_WIN_BASIC);
      ADD_PROFILING_POINT("elm_win_add", "stop");
          ECORE_X_ATOM_NET_WM_PID,
          ECORE_X_ATOM_CARDINAL, 32, &pid, 1);
      elm_win_conformant_set(window, EINA_TRUE);
 -    int w, h;
      ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
 +#else
 +    ecore_wl_screen_size_get(&w, &h);
 +#endif
      evas_object_resize(window, w, h);
+     elm_win_autodel_set(window, EINA_TRUE);
+     evas_object_smart_callback_add(window,
+                                    DELETE_REQUEST,
+                                    winDeleteRequestCallback,
+                                    this);
      evas_object_smart_callback_add(window,
-                                    ELM_EVENT_PROFILE_CHANGED,
+                                    PROFILE_CHANGED,
                                     winProfileChangedCallback,
                                     this);
+     setEvasObjectData(Layer::WINDOW, window);
      return window;
  }
  
  #define W3C_DEBUG_ENV_VARIABLE "DEBUG_LOAD_FINISH"
  
  // window signal callback
- const char *EDJE_SHOW_BACKWARD_SIGNAL = "show,backward,signal";
+ const char *EDJE_SHOW_PROGRESS_SIGNAL = "show,progress,signal";
+ const char *EDJE_HIDE_PROGRESS_SIGNAL = "hide,progress,signal";
  const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
  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 = LIBDIR_PREFIX "/libwrt-injected-bundle.so";
- const char* const caCertPath = "/opt/usr/share/certs/ca-certificate.crt";
 -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";
  
  // process pool
  const char* const DUMMY_PROCESS_PATH = "/usr/bin/wrt_launchpad_daemon_candidate";
@@@ -655,58 -672,119 +672,135 @@@ void WrtClient::setEwkInitialOrientatio
      }
  }
  
 +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;
+     // 1. share
+     WindowData::CtxpopupCallbackType shareCallback =
+         DPL::MakeDelegate(this, &WrtClient::ctxpopupShare);
+     WindowData::CtxpopupItemData shareData("Share",
+                                            std::string(),
+                                            shareCallback);
+     // 2. reload
+     WindowData::CtxpopupCallbackType reloadCallback =
+         DPL::MakeDelegate(this, &WrtClient::ctxpopupReload);
+     WindowData::CtxpopupItemData reloadData("Reload",
+                                             std::string(),
+                                             reloadCallback);
+     // 3. Open in browser
+     WindowData::CtxpopupCallbackType launchBrowserCallback =
+         DPL::MakeDelegate(this, &WrtClient::ctxpopupLaunchBrowser);
+     WindowData::CtxpopupItemData launchBrowserData("Open in browser",
+                                                    std::string(),
+                                                    launchBrowserCallback);
+     data.push_back(shareData);
+     data.push_back(reloadData);
+     data.push_back(launchBrowserData);
+     m_windowData->setCtxpopupItemData(data);
+ }
  
- void WrtClient::connectElmCallback()
+ void WrtClient::ctxpopupShare(void)
  {
-     Assert(m_windowData);
-     Assert(m_dao);
-     WrtDB::WidgetSettings widgetSettings;
-     m_dao->getWidgetSettings(widgetSettings);
-     WidgetSettingList settings(widgetSettings);
-     if (settings.getBackButtonPresence() == BackButton_Enable) {
-         m_windowData->addFloatBackButtonCallback(
-             "clicked",
-             &WrtClient::backButtonCallback,
-             this);
+     LogDebug("share");
+     const char* url = ewk_view_url_get(m_widget->GetCurrentWebview());
+     if (!url) {
+         LogError("url is empty");
+         return;
+     }
+     if (ClientModule::ServiceSupport::launchShareService(
+             elm_win_xwindow_get(m_windowData->getEvasObject(Layer::WINDOW)),
+             url))
+     {
+         LogDebug("success");
+     } else {
+         LogDebug("fail");
      }
 +    evas_object_smart_callback_add(m_windowData->m_win,
 +            "delete,request",
 +            &WrtClient::ExitCallback,
 +            this);
  }
  
- void WrtClient::setLayout(Evas_Object* newBuffer)
+ void WrtClient::ctxpopupReload(void)
  {
-     LogDebug("add new webkit buffer to window");
-     Assert(newBuffer);
+     LogDebug("reload");
+     ewk_view_reload(m_widget->GetCurrentWebview());
+ }
+ void WrtClient::ctxpopupLaunchBrowser(void)
+ {
+     LogDebug("launchBrowser");
+     const char* url = ewk_view_url_get(m_widget->GetCurrentWebview());
+     if (!url) {
+         LogError("url is empty");
+         return;
+     }
+     if (ClientModule::ServiceSupport::launchViewService(
+             elm_win_xwindow_get(m_windowData->getEvasObject(Layer::WINDOW)),
+             url))
+     {
+         LogDebug("success");
+     } else {
+         LogDebug("fail");
+     }
+ }
  
-     elm_object_part_content_set(m_windowData->m_user_layout,
-                                 ELM_SWALLOW_CONTENT,
-                                 newBuffer);
+ void WrtClient::hwkeyCallback(const std::string& key)
+ {
+     if (m_settingList->getBackButtonPresence() == BackButton_Enable
+         || m_currentViewMode == VIEWMODE_TYPE_WINDOWED)
+     {
+         // windowed UX - hosted application
+         if (key == KeyName::BACK) {
+             if (m_isWebkitFullscreen) {
+                 ewk_view_fullscreen_exit(m_widget->GetCurrentWebview());
+             } else {
+                 m_widget->Backward();
+             }
+         } else if (key == KeyName::MENU) {
+             // UX isn't confirmed
+             // m_windowData->showCtxpopup();
+         }
+     } else {
+         // packaged application
+         if (key == KeyName::BACK) {
+             if (m_isFullscreenByPlatform) {
+                 ewk_view_fullscreen_exit(m_widget->GetCurrentWebview());
+             }
+         }
+     }
+ }
  
-     evas_object_show(newBuffer);
+ void WrtClient::setLayout(Evas_Object* webview)
+ {
+     LogDebug("add new webkit buffer to window");
+     Assert(webview);
+     m_windowData->setWebview(webview);
+     evas_object_show(webview);
+     evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
  }
  
- void WrtClient::unsetLayout(Evas_Object* currentBuffer)
+ void WrtClient::unsetLayout(Evas_Object* webview)
  {
      LogDebug("remove current webkit buffer from window");
-     Assert(currentBuffer);
-     evas_object_hide(currentBuffer);
-     elm_object_part_content_unset(m_windowData->m_user_layout,
-                                   ELM_SWALLOW_CONTENT);
+     Assert(webview);
+     evas_object_hide(webview);
+     m_windowData->unsetWebview();
  }
  
  void WrtClient::shutdownStep()
@@@ -78,21 -81,36 +81,40 @@@ class WrtClient 
      // Events
      virtual void OnEventReceived(const NextStepEvent& event);
  
-     static void backButtonCallback(void* data,
-                                    Evas_Object* obj,
-                                    void* event_info);
-     // UI callback
 +    // UI callback
-     // Low Memory Callback
 +    static void ExitCallback(void* data,
 +                                   Evas_Object* obj,
 +                                   void* event_info);                                  
+     // static Callback
+     static Eina_Bool naviframeBackButtonCallback(void* data,
+                                                  Elm_Object_Item* it);
      static int appcoreLowMemoryCallback(void* data);
+     static int languageChangedCallback(void *data);
+     static void autoRotationCallback(void* data, Evas_Object* obj, void* event);
+     static void focusedCallback(void* data,
+                                 Evas_Object* obj,
+                                 void* eventInfo);
+     static void unfocusedCallback(void* data,
+                                   Evas_Object* obj,
+                                   void* eventInfo);
+     //view-mode
+     void setInitialViewMode();
  
      //orientation
-     void setOrientationWindow();
-     void unsetOrientationWindow();
-     void setOrientationEwk();
+     void setWindowOrientation(int angle);
+     void setWindowInitialOrientation();
+     void unsetWindowOrientation();
+     void setEwkInitialOrientation();
+     //ctxpopup
+     void setCtxpopupItem();
+     void ctxpopupShare();
+     void ctxpopupReload();
+     void ctxpopupLaunchBrowser();
+     // hwkey
+     void hwkeyCallback(const std::string& key);
  
      // launching steps
      void initStep();
@@@ -1,10 -1,10 +1,9 @@@
  [Unit]
  Description=Start the wrt_launchpad_daemon
- After=ac.service
  
  [Service]
 -EnvironmentFile=/etc/sysconfig/tizen-mobile-ui
 +EnvironmentFile=-/etc/sysconfig/wrt
  Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket
 -Environment=DISPLAY=:0
  Environment=XDG_RUNTIME_DIR=/run/user/%I
  ExecStart=/usr/bin/wrt_launchpad_daemon "                                                                                                                                                                                                         "
  KillSignal=SIGKILL