adding new popups for indexeddb, app cache and FS access request
[framework/osp/web.git] / src / controls / FWebCtrl_WebImpl.cpp
index aa75d06..f9ae898 100755 (executable)
@@ -47,6 +47,7 @@
 #include <FMediaImage.h>
 #include <FMediaImageTypes.h>
 #include <FNetHttpHttpHeader.h>
+#include <FSysVibrator.h>
 #include <FUiControl.h>
 #include <FUiCtrlKeypad.h>
 #include <FWebCtrlHitElementResult.h>
 #include <FBase_StringConverter.h>
 #include <FCnt_DownloadManagerImpl.h>
 #include <FGrp_CoordinateSystem.h>
+#include <FGrp_Screen.h>
 #include <FIo_DatabaseImpl.h>
 #include <FIo_NormalFile.h>
+#include <FSys_VibratorImpl.h>
 #include <FUi_Control.h>
 #include <FUi_CoordinateSystemUtils.h>
 #include <FUi_EcoreEvasMgr.h>
 #include "FWebCtrl_AuthConfirmPopup.h"
 #include "FWebCtrl_AuthenticationChallengeImpl.h"
 #include "FWebCtrl_EflWebkit.h"
-#include "FWebCtrl_GeolocationConfirmPopup.h"
 #include "FWebCtrl_GeolocationPermissionManagerImpl.h"
 #include "FWebCtrl_HitElementResultImpl.h"
 #include "FWebCtrl_InputPickerPopup.h"
+#include "FWebCtrl_WebNotification.h"
 #include "FWebCtrl_PageNavigationListImpl.h"
 #include "FWebCtrl_PromptPopup.h"
 #include "FWebCtrl_SelectBox.h"
@@ -115,6 +118,7 @@ using namespace Tizen::Graphics;
 using namespace Tizen::Io;
 using namespace Tizen::Media;
 using namespace Tizen::Net::Http;
+using namespace Tizen::System;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
 using namespace Tizen::Ui::Controls;
@@ -141,6 +145,7 @@ static const int MAX_TEXT_MATCH = pow(2, 31) - 1;
 
 static const int PORTRAIT_KEYPAD_HEIGHT = 444;
 static const int LANDSCAPE_KEYPAD_HEIGHT = 316;
+static const int DEFAULT_LIST_ITEM_COUNT = 4;
 
 
 Eina_Bool
@@ -334,20 +339,15 @@ OnScriptAlertRequested(Evas_Object* pView, const char* pMessage, void* pUserData
 {
        SysLog(NID_WEB_CTRL, "The current value of message is %s", pMessage);
 
-       result r = E_SUCCESS;
-
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        String msg(pMessage);
 
-       MessageBox messageBox;
-       r = messageBox.Construct(L"", msg, MSGBOX_STYLE_OK);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       int modalResult = 0;
-       r = messageBox.ShowAndWait(modalResult);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+       result r = pImpl->ShowUserConfirmPopupAsync(USER_SCRIPT_ALERT, pView, msg);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       return EINA_TRUE;
 
+CATCH:
        ewk_view_javascript_alert_reply(pView);
-
        return EINA_TRUE;
 }
 
@@ -358,7 +358,7 @@ OnScriptConfirmRequested(Evas_Object* pView, const char* pMessage, void* pUserDa
        SysLog(NID_WEB_CTRL, "The current value of message is %s", pMessage);
 
        result r = E_SUCCESS;
-
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        String msg(pMessage);
 
        MessageBox messageBox;
@@ -366,6 +366,9 @@ OnScriptConfirmRequested(Evas_Object* pView, const char* pMessage, void* pUserDa
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
 
        int modalResult = 0;
+
+       messageBox.SetOwner(&pImpl->GetPublic());
+
        r = messageBox.ShowAndWait(modalResult);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -388,32 +391,29 @@ OnScriptPromptRequested(Evas_Object* pView, const char* pMessage, const char* pD
        SysLog(NID_WEB_CTRL, "The current value of message is %s, defaulValue is %s", pMessage, pDefaultValue);
 
        result r = E_SUCCESS;
-
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        String msg(pMessage);
        String defVal(pDefaultValue);
 
-       int modalResult = -1;
-       Eina_Bool returnValue = EINA_TRUE;
-       _PromptPopup pPromptPopup;
+       std::unique_ptr< _PromptPopup > pPromptPopup(new (std::nothrow) _PromptPopup());
+       SysTryCatch(NID_WEB_CTRL, pPromptPopup.get(), , E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       r = pPromptPopup.Construct(msg, defVal);
-       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, returnValue = EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+       r = pPromptPopup->Construct(msg, defVal, pView);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = pPromptPopup.ShowAndWait(modalResult);
-       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, returnValue = EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+       pPromptPopup->SetOwner(&pImpl->GetPublic());
 
-       if (modalResult == ID_BUTTON_PROMPT_OK)
-       {
-               std::unique_ptr<char[]> pResult(_StringConverter::CopyToCharArrayN(pPromptPopup.GetPromptText()));
-               SysTryCatch(NID_WEB_CTRL, pResult.get(), returnValue = EINA_FALSE, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+       r = pPromptPopup->ShowPopup();
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-               ewk_view_javascript_prompt_reply(pView, pResult.get());
-               return EINA_TRUE;
-       }
+       pPromptPopup.release();
+
+       return EINA_TRUE;
 
 CATCH:
        ewk_view_javascript_prompt_reply(pView, null);
-       return returnValue;
+
+       return EINA_FALSE;
 }
 
 
@@ -424,16 +424,22 @@ OnCertificateRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
        Ewk_Certificate_Policy_Decision* pPolicy = reinterpret_cast< Ewk_Certificate_Policy_Decision* >(pEventInfo);
        SysAssertf(pImpl && pPolicy, "Failed to request");
 
-       ewk_certificate_policy_decision_suspend(pPolicy);
-
        switch (pImpl->GetSetting().GetCertificateErrorHandlingMode())
        {
        case WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM:
        {
+               if (pImpl->IsCertificateRequested())
+               {
+                       ewk_certificate_policy_decision_allowed_set(pPolicy, static_cast< Eina_Bool >(pImpl->IsCertificateConfirmed()));
+                       return;
+               }
+
                result r = E_SUCCESS;
 
-               r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_CERTIFICATE, pEventInfo);
+               r = pImpl->ShowCertificateConfirmPopup(CERTIFICATE_POPUP_MODE_USER_CONFIRM, pPolicy);
                SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+               pImpl->SetCertificateRequested(true);
                break;
        }
        case WEB_CERTIFICATE_ERROR_HANDLING_MODE_CANCEL:
@@ -487,6 +493,76 @@ OnHttpAuthenticationCanceled(void* pUserData, Evas_Object* pView, void* pEventIn
        }
 }
 
+Eina_Bool
+OnApplicationCachePermissionRequested(Evas_Object* pView, Ewk_Security_Origin* pSecOrigin,  void* pUserData)
+{
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pImpl , "Failed to request");
+
+       const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
+       String msg;
+       result r = msg.Format(256, L"Allow %s to use offline application cache?", pHostName);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_APP_CACHE, pView, msg);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return EINA_TRUE;
+}
+
+
+Eina_Bool
+OnIndexedDatabaseQuotaExceeded(Evas_Object* pView, Ewk_Security_Origin* pSecOrigin,  long long currentQuota, void* pUserData)
+{
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pImpl , "Failed to request");
+
+       const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
+       String msg;
+       result r = msg.Format(512, L"%s Used %lld of storage. Allow %s to use upto 2GB of indexed db?", pHostName, currentQuota, pHostName);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED, pView, msg);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return EINA_TRUE;
+}
+
+
+Eina_Bool
+OnDatabaseQuotaExceeded(Evas_Object* pView, Ewk_Security_Origin* pSecOrigin, const char* database_name, unsigned long long expectedQuota, void* pUserData)
+{
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pImpl , "Failed to request");
+
+       const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
+       String msg;
+       result r = msg.Format(512, L"Allow %s to open  %s use upto %lld  of web database?", pHostName, database_name, expectedQuota);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_DB_QUOTA_EXCEDED, pView, msg);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return EINA_TRUE;
+}
+
+
+Eina_Bool OnLocalFileSystemQuotaExceeded(Evas_Object* pView, Ewk_Security_Origin* pSecOrigin,  long long currentQuota, void* pUserData)
+{
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pImpl , "Failed to request");
+
+       const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
+       String msg;
+       result r = msg.Format(512, L"%s Used %lld of storgae. Allow %s to use upto 2GB of file system?", pHostName, currentQuota, pHostName);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED, pView, msg);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return EINA_TRUE;
+}
+
 
 void
 OnGeolocationPermissionRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
@@ -529,7 +605,7 @@ OnGeolocationPermissionRequested(void* pUserData, Evas_Object* pView, void* pEve
                {
                        ewk_geolocation_permission_request_suspend(pPermissionRequest);
 
-                       r = pImpl->ShowGeolocationPopup(pPermissionRequest);
+                       r = pImpl->ShowUserConfirmPopupAsync(USER_CONFIRM_GEOLOCATION, pPermissionRequest);
                        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
                }
 
@@ -548,7 +624,7 @@ OnGetUserMediaPermissionRequsted(void* pUserData, Evas_Object* pView, void* pEve
        Ewk_User_Media_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_User_Media_Permission_Request* >(pEventInfo);
        SysAssertf(pImpl && pPermissionRequest, "Failed to request");
 
-       result r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_USERMEDIA, pEventInfo);
+       result r = pImpl->ShowUserConfirmPopupAsync(USER_CONFIRM_USERMEDIA, pEventInfo);
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
        return;
 
@@ -560,20 +636,20 @@ CATCH:
 void
 OnNotificationPermissionRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
+       result r = E_SUCCESS;
        _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+
        Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(pEventInfo);
        SysAssertf(pImpl && pPermissionRequest, "Failed to request");
 
-       SysLog(NID_WEB_CTRL, "The permission popup has not Implemented yet. allow is the default value now.");
-
-       //ToDo : Show NotificationPermissionPopup
-
-       Ewk_Context* pContext = ewk_view_context_get(pView);
-       SysAssertf(pContext, "Failed to get webkit instance.");
+       ewk_notification_permission_request_suspend(pPermissionRequest);
 
-       //ewk_notification_permission_request_origin_get(pPermissionRequest);
+       r = pImpl->ShowUserConfirmPopupAsync(USER_CONFIRM_NOTIFICATION, pPermissionRequest);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       return;
 
-       ewk_notification_permission_request_set(pPermissionRequest, EINA_TRUE);
+CATCH:
+       ewk_notification_permission_request_set(pPermissionRequest, EINA_FALSE);
 }
 
 
@@ -584,17 +660,26 @@ OnNotificationShow(void* pUserData, Evas_Object* pView, void* pEventInfo)
        Ewk_Notification* pNotification = reinterpret_cast< Ewk_Notification* >(pEventInfo);
        SysAssertf(pImpl && pNotification, "Failed to request");
 
+       result r = E_SUCCESS;
        Ewk_Context* pContext = ewk_view_context_get(pView);
        SysAssertf(pContext, "Failed to get webkit instance.");
+       uint64_t notificationId = ewk_notification_id_get(pNotification);
 
-       //ToDo : Show Notification
-       //Perform ewk_notification_clicked
        //ewk_notification_security_origin_get(pNotification)
-       SysLog(NID_WEB_CTRL, "The current value of title is %s", ewk_notification_title_get(pNotification));
-       SysLog(NID_WEB_CTRL, "The current value of body is %s", ewk_notification_body_get(pNotification));
-       SysLog(NID_WEB_CTRL, "The current value of icon path is %s",ewk_notification_icon_url_get(pNotification));
 
-       uint64_t notificationId = ewk_notification_id_get(pNotification);
+       const char* text = ewk_notification_body_get(pNotification);
+       SysSecureLog(NID_WEB_CTRL, "The current value of icon path is %s",ewk_notification_icon_url_get(pNotification));
+
+       std::unique_ptr<_WebNotification> pNotificationWindow( new (std::nothrow) _WebNotification());
+       SysTryReturnVoidResult(NID_WEB_CTRL, pNotificationWindow.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+       r = pNotificationWindow->Construct(pContext, notificationId, pImpl);
+       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Error propogated.", GetErrorMessage(r));
+
+       pNotificationWindow->SetText(String(text));
+       pNotificationWindow->LaunchNotification();
+       pNotificationWindow.release();
+
        ewk_notification_showed(pContext, notificationId);
 }
 
@@ -613,63 +698,131 @@ OnNotificationCancel(void* pUserData, Evas_Object* pView, void* pEventInfo)
 void
 OnProtocolHandlerRegistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
+       result r = E_SUCCESS;
        _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
-       Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
-       SysAssertf(pImpl && pHandlerData, "Failed to request");
+       SysAssertf(pImpl, "Failed to request");
 
-       ewk_custom_handlers_data_target_get(pHandlerData);
-       ewk_custom_handlers_data_base_url_get(pHandlerData);
-       ewk_custom_handlers_data_url_get(pHandlerData);
-       ewk_custom_handlers_data_title_get(pHandlerData);
+       r = pImpl->ShowUserConfirmPopup(USER_PROTOCOL_HANDLER, pEventInfo);
+       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 }
 
 
 void
 OnIsProtocolHandlerRegistered(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
+       int checkHandler = 0;
        _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
        Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
        SysAssertf(pImpl && pHandlerData, "Failed to request");
 
-       ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_REGISTERED);
+       checkHandler = pImpl->SearchHandler(pHandlerData, false);
+       SysTryReturnVoidResult(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+       switch (checkHandler)
+       {
+       case -1:
+               return;
+       case 0:
+               ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_DECLINED);
+               break;
+       case 1:
+               ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_REGISTERED);
+               break;
+       case 2:
+               ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_NEW);
+               break;
+       default:
+               SysAssert(false);
+       }
 }
 
-
 void
 OnProtocolHandlerUnregistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
+       result r = E_SUCCESS;
        _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
        Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
        SysAssertf(pImpl && pHandlerData, "Failed to request");
+
+       r = pImpl->UnregistrationHandler(pHandlerData, false);
+       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 }
 
 
 void
 OnContentHandlerRegistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
+       result r = E_SUCCESS;
        _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
-       Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
-       SysAssertf(pImpl && pHandlerData, "Failed to request");
+       SysAssertf(pImpl, "Failed to request");
+       
+       r = pImpl->ShowUserConfirmPopup(USER_CONTENT_HANDLER, pEventInfo);
+       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 }
 
 
 void
 OnIsContentHandlerRegistered(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
+       int checkHandler = 0;
        _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
        Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
        SysAssertf(pImpl && pHandlerData, "Failed to request");
 
-       ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_REGISTERED);
+       checkHandler = pImpl->SearchHandler(pHandlerData, true);
+       SysTryReturnVoidResult(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+       
+       switch (checkHandler)
+       {
+       case -1:
+               return;
+       case 0:
+               ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_DECLINED);
+               break;
+       case 1:
+               ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_REGISTERED);
+               break;
+       case 2:
+               ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_NEW);
+               break;
+       default:
+               SysAssert(false);
+       }
 }
 
 
 void
 OnContentHandlerUnregistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
+       result r = E_SUCCESS;
        _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
        Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
        SysAssertf(pImpl && pHandlerData, "Failed to request");
+
+       r = pImpl->UnregistrationHandler(pHandlerData, true);
+       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+}
+
+
+void
+OnVibrationRequested(uint64_t duration, void* pUserData)
+{
+       result r = E_SUCCESS;
+
+       _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+       SysAssertf(pImpl, "Failed to request");
+
+       r = pImpl->VibrationRequested(duration);
+       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+}
+
+
+void
+OnVibrationCanceled(void* pUserData)
+{
+       _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+       SysAssertf(pImpl, "Failed to request");
+
+       pImpl->VibrationCanceled();
 }
 
 
@@ -681,7 +834,7 @@ OnLoadingRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
        SysAssertf(pImpl && pPolicy, "Failed to request");
 
        String url(ewk_policy_decision_url_get(pPolicy));
-       SysLog(NID_WEB_CTRL, "The current value of url is %ls", url.GetPointer());
+       SysSecureLog(NID_WEB_CTRL, "The current value of url is %ls", url.GetPointer());
 
        if (url == L"about:blank")
        {
@@ -692,6 +845,8 @@ OnLoadingRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
        if (pImpl->GetLoadingListener() && ewk_frame_is_main_frame(ewk_policy_decision_frame_get(pPolicy))
                && !pImpl->IsRedirectRequested())
        {
+               pImpl->SetCertificateRequested(false);
+
                if (pImpl->GetTextSearchListener())
                {
                        pImpl->DisableAsyncSearch();
@@ -732,6 +887,16 @@ OnLoadingRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
                }
        }
 
+       String currentUrl(pImpl->GetUrl());
+       String redirectUrl(pImpl->GetProtocolFromUri(url,  currentUrl));
+       if (redirectUrl != L"")
+       {
+               pImpl->LoadUrl(redirectUrl);
+               ewk_policy_decision_ignore(pPolicy);
+
+               return;
+       }
+       
        Uri uri;
        uri.SetUri(url);
 
@@ -874,9 +1039,13 @@ OnWebDataReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
        const char* pUrl = ewk_policy_decision_url_get(pPolicy);
        int code = ewk_policy_decision_response_status_code_get(pPolicy);
        String mime(ewk_policy_decision_response_mime_get(pPolicy));
-       SysLog(NID_WEB_CTRL, "url : %s, mime : %ls, code : %d", pUrl, mime.GetPointer(), code);
+       SysSecureLog(NID_WEB_CTRL, "url : %s, mime : %ls, code : %d", pUrl, mime.GetPointer(), code);
 
        ILoadingListener* pLoadingListener = pImpl->GetLoadingListener();
+
+       String url(ewk_policy_decision_url_get(pPolicy));
+
+       
        if (pLoadingListener && ewk_frame_is_main_frame(ewk_policy_decision_frame_get(pPolicy)))
        {
                const Eina_Hash* pHeader = ewk_policy_decision_response_headers_get(pPolicy);
@@ -901,6 +1070,16 @@ OnWebDataReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
        {
        case WEB_DECISION_CONTINUE:
        {
+               String currentUrl(pImpl->GetUrl());
+               String redirectUrl(pImpl->GetRedirectUri(url, currentUrl, mime));
+               if (redirectUrl != L"")
+               {
+                       pImpl->LoadUrl(redirectUrl);
+                       ewk_policy_decision_ignore(pPolicy);
+
+                       return;
+               }
+
                if (pImpl->IsMimeSupported(mime) || mime == L"")
                {
                        break;
@@ -908,7 +1087,7 @@ OnWebDataReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
                
                else
                {
-                       SysLog(NID_WEB_CTRL, "Lauch native app to handle the mime");
+                       SysLog(NID_WEB_CTRL, "Launch native app to handle the mime");
 
                        ewk_policy_decision_ignore(pPolicy);
 
@@ -1119,12 +1298,33 @@ OnLoadingCommitted(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
 
 void
+OnFaviconReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pImpl, "Failed to request");
+
+       if (pImpl->GetLoadingListener())
+       {
+               result r = E_SUCCESS;
+
+               std::unique_ptr<_LoadingEventArg> pEventArg(new (std::nothrow) _LoadingEventArg(WEB_EVENT_LOADINGLISTENER_FAVICON_RECEIVED));
+               SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+               r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+               SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+               pEventArg.release();
+       }
+
+}
+
+
+void
 OnDidStartDownloadCallback(const char* pUrl, void* pUserData)
 {
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        SysAssertf(pUrl && pImpl != null, "Failed to request");
 
-       SysLog(NID_WEB_CTRL, "The current value of url is %s", pUrl);
+       SysSecureLog(NID_WEB_CTRL, "The current value of url is %s", pUrl);
 }
 
 
@@ -1223,8 +1423,13 @@ void
 OnWebWindowClosedRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
        _WebImpl* pChildImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pChildImpl, "Failed to request");
+
        _WebImpl* pParentImpl = reinterpret_cast< _WebImpl* >(evas_object_data_get(pView, PARENT_WEB_CTRL));
-       SysAssertf(pChildImpl && pParentImpl, "Failed to request");
+       if (pParentImpl == null)
+       {
+               return;
+       }
 
        if (pParentImpl->GetUiEventListener())
        {
@@ -1254,9 +1459,11 @@ FireWebPreventDefaultTriggeredEvent(_WebImpl* pImpl, int event, bool trigger)
 
        r = pEventArg->SetEventInfo(_WebUiEventArg::PREVENT_DEFAULT, *pPreventTrigger.get());
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       pPreventTrigger.release();
 
        r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       pEventArg.release();
 
        return E_SUCCESS;
 }
@@ -1286,96 +1493,199 @@ OnWebPreventDefaultTriggered(void* pUserData, Evas_Object* pView, void* pEventIn
 }
 
 
-Eina_Bool
-OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData)
+result
+FireWebPageBlockSelectedEvent(_WebImpl* pImpl)
 {
-       Eina_Bool ret = EINA_FALSE;
-       Eina_List* pSelectedFileNames = null;
-       String isMultipleSelection(L"single");
+       result r = E_SUCCESS;
 
-       if (multipleFile)
+       std::unique_ptr<Point> startPoint(new (std::nothrow) Point());
+       std::unique_ptr<Point> endPoint(new (std::nothrow) Point());
+       SysTryReturnResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+       pImpl->GetBlockRange(*startPoint.get(), *endPoint.get());
+
+       if ((endPoint->x != 0) && (endPoint->y != 0))
        {
-               isMultipleSelection.Append(L"multiple");
+               std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED));
+               SysTryReturnResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+               r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               startPoint.release();
+
+               r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               endPoint.release();
+
+               r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               pEventArg.release();
        }
 
-       std::unique_ptr<_MediaSelectionListener> pMediaListener(new (std::nothrow) _MediaSelectionListener());
-       SysTryCatch(NID_WEB_CTRL, pMediaListener.get(), , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+       return E_SUCCESS;
+}
 
+
+result
+FireWebPageBlockSelectedEventF(_WebImpl* pImpl)
+{
+       result r = E_SUCCESS;
+
+       std::unique_ptr<FloatPoint> startPoint(new (std::nothrow) FloatPoint());
+       std::unique_ptr<FloatPoint> endPoint(new (std::nothrow) FloatPoint());
+
+       SysTryReturnResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+       pImpl->GetBlockRange(*startPoint.get(), *endPoint.get());
+
+       if ((endPoint->x != 0.0f) && (endPoint->y != 0.0f))
        {
-               int itemCount = eina_list_count(pAcceptTypes);
-               String fileType = L"all";
+               std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED_FLOAT));
+               SysTryReturnResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
-               if (itemCount == 1)
-               {
-                       String item((char*)eina_list_nth(pAcceptTypes, 0));
-                       if (item.StartsWith("image/",0))
-                       {
-                               fileType = L"image";
-                       }
-                       else if (item.StartsWith("audio/",0))
-                       {
-                               fileType = L"audio";
-                       }
-                       else if (item.StartsWith("video/",0))
-                       {
-                               fileType = L"video";
-                       }
-               }
+               r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               startPoint.release();
 
-               HashMap dataList;
-               result r = dataList.Construct();
-               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+               r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               endPoint.release();
 
-               String mode(L"selectionType");
-               r = dataList.Add(mode, isMultipleSelection);
-               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+               r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               pEventArg.release();
+       }
 
-               String type(L"type");
-               r = dataList.Add(type, fileType);
-               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       return E_SUCCESS;
+}
 
-               std::unique_ptr<AppControl> pMediaAppControl(_AppManagerImpl::FindAppControlN(L"tizen.filemanager", L"http://tizen.org/appcontrol/operation/pick"));
-               SysTryCatch(NID_WEB_CTRL, pMediaAppControl.get(), r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-               _AppControlImpl* pMediaAppControlImpl = _AppControlImpl::GetInstance(*pMediaAppControl);
-               r = pMediaAppControlImpl->Start(null, null, &dataList, pMediaListener.get());
-               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+void
+OnWebPageBlockSelected(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pImpl, "Failed to request");
 
-               while (true)
-               {
-                       if (pMediaListener->IsSelectionCompleted())
-                       {
-                               const ArrayList* pSelectedFiles = pMediaListener->GetSelectedFiles();
-                               SysTryCatch(NID_WEB_CTRL, pSelectedFiles, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+       if (pImpl->GetUiEventListener())
+       {
+               result r = E_SUCCESS;
 
-                               int fileCount = pSelectedFiles->GetCount();
+               r = FireWebPageBlockSelectedEvent(pImpl);
+               SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       if (pImpl->GetUiEventListenerF())
+       {
+               result r = E_SUCCESS;
 
-                               for (int i = 0; i < fileCount; i++)
-                               {
-                                       String* pFile = (String*)pSelectedFiles->GetAt(i);
-                                       SysTryCatch(NID_WEB_CTRL, pFile, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+               r = FireWebPageBlockSelectedEventF(pImpl);
+               SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+}
 
-                                       std::unique_ptr<ByteBuffer> pByteBuf(StringUtil::StringToUtf8N(*pFile));
-                                       SysTryCatch(NID_WEB_CTRL, pByteBuf.get(), r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-                                       pSelectedFileNames = eina_list_append(pSelectedFileNames, strdup((const char*)pByteBuf->GetPointer()));
-                               }
+void
+OnWebPageBlockSelectedByOrientation(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+       SysAssertf(pImpl, "Failed to request");
 
-                               ret = EINA_TRUE;
-                               break;
-                       }
+       if (!pImpl->IsOrientationChanged())
+       {
+               return;
+       }
 
-                       ecore_main_loop_iterate();
-               }
+       pImpl->SetOrientationChanged(false);
 
-               ewk_view_open_panel_reply(pView, pSelectedFileNames, ret);
-               return ret;
+       int orientation = 0;
+       _ControlRotation rotation = _ControlManager::GetInstance()->GetOrientationStatus();
+       switch (rotation)
+       {
+               case _CONTROL_ROTATION_0:
+                       orientation =  0;
+                       break;
+               case _CONTROL_ROTATION_90:
+                       orientation =  90;
+                       break;
+               case _CONTROL_ROTATION_180:
+                       orientation =  180;
+                       break;
+               case _CONTROL_ROTATION_270:
+                       orientation =  -90;
+                       break;
        }
+       ewk_view_orientation_send(pView, orientation);
+
+       OnWebPageBlockSelected(pUserData, pView, pEventInfo);
+}
+
+
+Eina_Bool
+OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData)
+{
+       String isMultipleSelection(L"single");
+       result r = E_SUCCESS;
+
+       HashMap dataList;
+       String mode(L"selectionType");
+       String type(L"type");
+       _AppControlImpl* pMediaAppControlImpl = null;
+
+       int itemCount = 0;
+       String fileType = L"all";
+
+       if (multipleFile)
+       {
+               isMultipleSelection.Append(L"multiple");
+       }
+
+       std::unique_ptr<AppControl> pMediaAppControl(_AppManagerImpl::FindAppControlN(L"tizen.filemanager", L"http://tizen.org/appcontrol/operation/pick"));
+       SysTryReturn(NID_WEB_CTRL, pMediaAppControl.get(), EINA_TRUE, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       std::unique_ptr<_MediaSelectionListener> pMediaListener(new (std::nothrow) _MediaSelectionListener());
+       SysTryReturn(NID_WEB_CTRL, pMediaListener.get(), EINA_TRUE, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       pMediaListener->Construct(pView, pMediaAppControl.get());
+
+       itemCount = eina_list_count(pAcceptTypes);
+
+       if (itemCount == 1)
+       {
+               String item((char*)eina_list_nth(pAcceptTypes, 0));
+               if (item.StartsWith("image/",0))
+               {
+                       fileType = L"image";
+               }
+               else if (item.StartsWith("audio/",0))
+               {
+                       fileType = L"audio";
+               }
+               else if (item.StartsWith("video/",0))
+               {
+                       fileType = L"video";
+               }
+       }
+
+       r = dataList.Construct();
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = dataList.Add(mode, isMultipleSelection);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = dataList.Add(type, fileType);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       pMediaAppControlImpl = _AppControlImpl::GetInstance(*pMediaAppControl.get());
+       r = pMediaAppControlImpl->Start(null, null, &dataList, pMediaListener.get());
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       pMediaListener.release();
+       pMediaAppControl.release();
+
+       return EINA_TRUE;
 
 CATCH:
-       ewk_view_open_panel_reply(pView, null, ret);
-       eina_list_free(pSelectedFileNames);
-       return ret;
+       ewk_view_open_panel_reply(pView, null, EINA_FALSE);
+       return EINA_TRUE;
 }
 
 
@@ -1422,12 +1732,15 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                }
 
                _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-               if (pFormCore->HasFooter() && pFormCore->IsFooterVisible())
+               if (pFormCore)
                {
-                       pImpl->SetFooterVisibleState(true);
-                       pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+                       if (pFormCore->HasFooter() && pFormCore->IsFooterVisible())
+                       {
+                               pImpl->SetFooterVisibleState(true);
+                               pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+                       }
+
+                       pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
                }
 
                if (pImpl->GetWebKeypadEventListener())
@@ -1441,7 +1754,6 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                        }
                        else
                        {
-                               pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
                                pImpl->GetWebKeypadEventListener()->OnWebKeypadWillOpen(*dynamic_cast< Web* >(&pImpl->GetPublic()));
                        }
                }
@@ -1476,15 +1788,16 @@ OnWebKeypadClosed(void* pUserData, Evas_Object* pView, void* pEventInfo)
        SysAssertf(pImpl, "Failed to request");
 
        _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
-       SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-       if (pFormCore->HasFooter() && pImpl->IsFooterVisible())
+       if (pFormCore)
        {
-               pImpl->SetFooterVisibleState(false);
-               pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
-       }
+               if (pFormCore->HasFooter() && pImpl->IsFooterVisible())
+               {
+                       pImpl->SetFooterVisibleState(false);
+                       pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
+               }
 
-       pFormCore->DeflateClientRectHeight(0);
+               pFormCore->DeflateClientRectHeight(0);
+       }
 
        if (pImpl->GetWebKeypadEventListener())
        {
@@ -1680,7 +1993,11 @@ OnScriptExecuted(Evas_Object* pView, const char* pResult, void* pUserData)
        String result(pResult);
        SysLog(NID_WEB_CTRL, "result : %ls", result.GetPointer());
 
-       pPresenter->EndAsyncProcess(result);
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(evas_object_data_get(pView, WEB_CTRL));
+       if (pImpl && pImpl->IsPresenterAlived(pPresenter))
+       {
+               pPresenter->EndAsyncProcess(result);
+       }
 }
 
 
@@ -1788,6 +2105,9 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
        , __isKeypadOpened(false)
        , __isLoadingErrorOccurred(false)
        , __isRedirectRequested(false)
+       , __isCertificateRequested(false)
+       , __isCertificateConfirmed(false)
+       , __isOrientationChanged(false)
        , __keypadBounds(0, 0, 0, 0)
        , __pWebCore(null)
        , __pUserLoadingListener(null)
@@ -1796,7 +2116,6 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
        , __pUserKeypadEventListener(null)
        , __pTextSearchListener(null)
        , __pKeypad(null)
-       , __pWebSetting(null)
        , __pJsBridgeList(null)
        , __pJsProvider(null)
        , __pJsComparer(null)
@@ -1805,11 +2124,13 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
        , __pAuthChallenge(null)
        , __pAuthPopup(null)
        , __pUserConfirmPopup(null)
-       , __pGeolocationPopup(null)
+       , __pCertConfirmPopup(null)
        , __pSelectBox(null)
        , __pDatePicker(null)
        , __pColorPicker(null)
+       , __pVibrator(null)
        , __policy(WEB_DECISION_CONTINUE)
+       , __defaultUserAgent(L"")
 {
        __textSearch.__searchAll = false;
        __textSearch.__searchForward = true;
@@ -1899,8 +2220,8 @@ _WebImpl::Construct(void)
        r = __textSearch.__searchQueue.Construct();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       __pWebSetting = std::unique_ptr<WebSetting>(new (std::nothrow) WebSetting());
-       SysTryReturn(NID_WEB_CTRL, __pWebSetting.get(), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+       r = __callbackList.Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = InitJsBridgeList();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
@@ -1911,8 +2232,6 @@ _WebImpl::Construct(void)
        __pWebCore = dynamic_cast< _Web* >(&(GetCore()));
        SysTryReturnResult(NID_WEB_CTRL, __pWebCore, E_SYSTEM, "A system error has been occurred. Failed to get web control");
 
-       __pWebCore->SetWebSettingImpl(_WebSettingImpl::GetInstance(__pWebSetting.get()));
-
        return E_SUCCESS;
 }
 
@@ -1922,17 +2241,19 @@ _WebImpl::InitializeSetting(void)
 {
        result r = E_SUCCESS;
 
-       r = SetSetting(*__pWebSetting.get());
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       WebSetting* pWebSetting = __pWebCore->GetSetting();
+       _WebSettingImpl* pWebSettingImpl = _WebSettingImpl::GetInstance(pWebSetting);
 
-       SetCookieEnabled(_WebSettingImpl::GetInstance(__pWebSetting.get())->IsCookieEnabled());
-       SetPrivateBrowsingEnabled(_WebSettingImpl::GetInstance(__pWebSetting.get())->IsPrivateBrowsingEnabled());
-       SetZoomLevel(_WebSettingImpl::GetInstance(__pWebSetting.get())->GetZoomLevel());
+       SetCookieEnabled(pWebSettingImpl->IsCookieEnabled());
+       SetPrivateBrowsingEnabled(pWebSettingImpl->IsPrivateBrowsingEnabled());
+       SetZoomLevel(pWebSettingImpl->GetZoomLevel());
 
-       SetEventListenerCallback();
+       __defaultUserAgent = pWebSettingImpl->GetUserAgent();
 
-       _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-       SysAssertf(pFormCore != null, "Failed to get FormCore");
+       r = SetSetting(*pWebSetting);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       SetEventListenerCallback();
 
        return E_SUCCESS;
 }
@@ -2041,7 +2362,6 @@ _WebImpl::LoadUrl(const String& url, const HttpHeader& header)
 result
 _WebImpl::LoadUrlWithPostRequest(const String& url, const HttpHeader& header, const ByteBuffer& body) const
 {
-
        std::unique_ptr<char[]> pUrl(_StringConverter::CopyToCharArrayN(url));
        SysTryReturn(NID_WEB_CTRL, pUrl.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
@@ -2058,6 +2378,8 @@ _WebImpl::LoadUrlWithPostRequest(const String& url, const HttpHeader& header, co
 result
 _WebImpl::LoadData(const String& baseUrl, const ByteBuffer& content, const String& mime, const String& encoding) const
 {
+       SysTryReturnResult(NID_WEB_CTRL, content.GetLimit() > 0, E_INVALID_ARG, "The content buffer is empty.");
+
        std::unique_ptr<char[]> pUrl(_StringConverter::CopyToCharArrayN(baseUrl));
        std::unique_ptr<char[]> pMime(_StringConverter::CopyToCharArrayN(mime));
        std::unique_ptr<char[]> pEncoding(_StringConverter::CopyToCharArrayN(encoding));
@@ -2088,15 +2410,14 @@ _WebImpl::ShowSelectBoxPopup(bool isMultiSelect, const String& title, Eina_List*
 {
        __pSelectBox.reset();
 
-       int itemCount = eina_list_count(pItems);
-       SysTryReturnResult(NID_WEB_CTRL, itemCount > 0, E_SYSTEM, "ItemCount is invalid.");
+       SysTryReturnResult(NID_WEB_CTRL, eina_list_count(pItems) > 0, E_SYSTEM, "ItemCount is invalid.");
 
        result r = E_SUCCESS;
 
        std::unique_ptr<_SelectBox> pSelectBox(new (std::nothrow) _SelectBox());
        SysTryReturnResult(NID_WEB_CTRL, pSelectBox.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       r = pSelectBox->Construct(isMultiSelect, title, itemCount, pWebView);
+       r = pSelectBox->Construct(isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT, pWebView);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = pSelectBox->UpdateList(pItems, selectedIndex, false, false);
@@ -2104,6 +2425,8 @@ _WebImpl::ShowSelectBoxPopup(bool isMultiSelect, const String& title, Eina_List*
 
        __pSelectBox = std::move(pSelectBox);
 
+       __pSelectBox->SetOwner(&GetPublic());
+
        return __pSelectBox->ShowPopup();
 }
 
@@ -2209,26 +2532,42 @@ _WebImpl::Reload(void) const
 
 
 String*
-_WebImpl::EvaluateJavascriptN(const String& scriptCode) const
+_WebImpl::EvaluateJavascriptN(const String& scriptCode)
 {
-       if (scriptCode.GetLength())
+       if (scriptCode.GetLength() == 0)
        {
-               std::unique_ptr<char[]> pScript(_StringConverter::CopyToCharArrayN(scriptCode));
-               SysTryReturn(NID_WEB_CTRL, pScript.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               return null;
+       }
+       
+       result r = E_SUCCESS;
 
-               _WebPresenter presenter;
-               presenter.InitAsyncProcess();
+       std::unique_ptr<char[]> pScript(_StringConverter::CopyToCharArrayN(scriptCode));
+       SysTryReturn(NID_WEB_CTRL, pScript.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
-               ewk_view_script_execute(__pWebCore->GetWebNativeNode(), pScript.get(), OnScriptExecuted, &presenter);
+       std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter());
+       SysTryReturn(NID_WEB_CTRL, pPresenter.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-               Tizen::Base::String* pResult = new (std::nothrow) Tizen::Base::String(L"");
-               SysTryReturn(NID_WEB_CTRL, pResult, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-               presenter.WaitAsyncProcess(*pResult);
+       r = __callbackList.Add(pPresenter.get());
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               return pResult;
-       }
+       ewk_view_script_execute(__pWebCore->GetWebNativeNode(), pScript.get(), OnScriptExecuted, pPresenter.get());
 
-       return null;
+       std::unique_ptr<String> pResult(new (std::nothrow) String(L""));
+       SysTryReturn(NID_WEB_CTRL, pResult.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+       pPresenter->WaitAsyncProcess(*pResult.get());
+       
+       r = __callbackList.Remove(*pPresenter.get());
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+       pPresenter.release();
+       
+       return pResult.release();
+}
+
+
+bool
+_WebImpl::IsPresenterAlived(_WebPresenter* pPresenter) const
+{
+       return __callbackList.Contains(*pPresenter);
 }
 
 
@@ -2302,7 +2641,7 @@ _WebImpl::GetBackForwardListN(void) const
 
                url = ewk_history_item_uri_get(pEwkItem);
                title = ewk_history_item_title_get(pEwkItem);
-               SysLog(NID_WEB_CTRL, "The current value of url is %s, title is %s", url.GetPointer(), title.GetPointer());
+               SysSecureLog(NID_WEB_CTRL, "The current value of url is %s, title is %s", url.GetPointer(), title.GetPointer());
 
                pHistoryItemImpl->SetHistoryItem(url, title);
 
@@ -2552,10 +2891,13 @@ _WebImpl::SetSetting(const WebSetting& setting)
 
                ewk_settings_loads_images_automatically_set(pSettings, static_cast< Eina_Bool >(setting.IsAutoImageLoadEnabled()));
 
-               std::unique_ptr<char[]> pAgent(_StringConverter::CopyToCharArrayN(setting.GetUserAgent()));
-               SysTryReturn(NID_WEB_CTRL, pAgent.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               if (__defaultUserAgent != setting.GetUserAgent())
+               {
+                       std::unique_ptr<char[]> pAgent(_StringConverter::CopyToCharArrayN(setting.GetUserAgent()));
+                       SysTryReturn(NID_WEB_CTRL, pAgent.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
-               ewk_view_user_agent_set(__pWebCore->GetWebNativeNode(), pAgent.get());
+                       ewk_view_user_agent_set(__pWebCore->GetWebNativeNode(), pAgent.get());
+               }
 
                ewk_settings_auto_fitting_set(pSettings, static_cast< Eina_Bool >(setting.IsAutoFittingEnabled()));
 
@@ -2566,19 +2908,21 @@ _WebImpl::SetSetting(const WebSetting& setting)
                ewk_settings_autofill_password_form_enabled_set(pSettings,  static_cast< Eina_Bool >(setting.IsAutoLoginFormFillEnabled()));
        }
 
-       __pWebSetting->SetCertificateErrorHandlingMode(setting.GetCertificateErrorHandlingMode());
-       __pWebSetting->SetDefaultTextEncoding(setting.GetDefaultTextEncoding());
-       __pWebSetting->SetCacheControl(setting.GetCacheControl());
-       __pWebSetting->SetFontSize(setting.GetFontSize());
-       __pWebSetting->SetJavascriptEnabled(setting.IsJavascriptEnabled());
-       __pWebSetting->SetAutoImageLoadEnabled(setting.IsAutoImageLoadEnabled());
-       __pWebSetting->SetInputStyle(setting.GetInputStyle());
-       __pWebSetting->SetUserAgent(setting.GetUserAgent());
-       __pWebSetting->SetAutoFittingEnabled(setting.IsAutoFittingEnabled());
-       __pWebSetting->SetJavaScriptPopupEnabled(setting.IsJavaScriptPopupEnabled());
-       __pWebSetting->SetGeolocationEnabled(setting.IsGeolocationEnabled());
-       __pWebSetting->SetAutoFormDataShowEnabled(setting.IsAutoFormDataShowEnabled());
-       __pWebSetting->SetAutoLoginFormFillEnabled(setting.IsAutoLoginFormFillEnabled());
+       _WebSettingImpl* pWebSettingImpl = _WebSettingImpl::GetInstance(__pWebCore->GetSetting());
+
+       pWebSettingImpl->SetCertificateErrorHandlingMode(setting.GetCertificateErrorHandlingMode());
+       pWebSettingImpl->SetDefaultTextEncoding(setting.GetDefaultTextEncoding());
+       pWebSettingImpl->SetCacheControl(setting.GetCacheControl());
+       pWebSettingImpl->SetFontSize(setting.GetFontSize());
+       pWebSettingImpl->SetJavascriptEnabled(setting.IsJavascriptEnabled());
+       pWebSettingImpl->SetAutoImageLoadEnabled(setting.IsAutoImageLoadEnabled());
+       pWebSettingImpl->SetInputStyle(setting.GetInputStyle());
+       pWebSettingImpl->SetUserAgent(setting.GetUserAgent());
+       pWebSettingImpl->SetAutoFittingEnabled(setting.IsAutoFittingEnabled());
+       pWebSettingImpl->SetJavaScriptPopupEnabled(setting.IsJavaScriptPopupEnabled());
+       pWebSettingImpl->SetGeolocationEnabled(setting.IsGeolocationEnabled());
+       pWebSettingImpl->SetAutoFormDataShowEnabled(setting.IsAutoFormDataShowEnabled());
+       pWebSettingImpl->SetAutoLoginFormFillEnabled(setting.IsAutoLoginFormFillEnabled());
 
        return E_SUCCESS;
 }
@@ -2587,13 +2931,22 @@ _WebImpl::SetSetting(const WebSetting& setting)
 WebSetting
 _WebImpl::GetSetting(void) const
 {
-       return *__pWebSetting;
+       return *__pWebCore->GetSetting();
 }
 
 
 const HitElementResult*
 _WebImpl::GetElementByPointN(const Point& point) const
 {
+       return GetElementByPointN(_CoordinateSystemUtils::ConvertToFloat(point));
+}
+
+
+const HitElementResult*
+_WebImpl::GetElementByPointN(const FloatPoint& point) const
+{
+       SysTryReturn(NID_WEB_CTRL, Contains(point), null, E_INVALID_ARG, "[%s] The point must be contained in the bounds of a web control.", GetErrorMessage(E_INVALID_ARG));
+
        result r = E_SUCCESS;
 
        _HitElementResultImpl* pHitElementResultImpl = null;
@@ -2602,7 +2955,7 @@ _WebImpl::GetElementByPointN(const Point& point) const
        std::unique_ptr<Bitmap> pImage;
        std::unique_ptr<HashMap, AllElementsDeleter> pAttributeMap;
 
-       Point absPoint(__pWebCore->GetAbsoluteCoordinate(point));
+       Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(point)));
 
        Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(__pWebCore->GetWebNativeNode(), absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL);
        SysTryReturn(NID_WEB_CTRL, pEwkHitTest, null, E_SYSTEM, "[%s] Failed to get hit test.", GetErrorMessage(E_SYSTEM));
@@ -2613,7 +2966,7 @@ _WebImpl::GetElementByPointN(const Point& point) const
        String tagName(ewk_hit_test_tag_name_get(pEwkHitTest));
        String nodeValue(ewk_hit_test_node_value_get(pEwkHitTest));
 
-       SysLog(NID_WEB_CTRL, "The current value of url is %ls, tag is %ls, value is %ls", url.GetPointer(), tagName.GetPointer(), nodeValue.GetPointer());
+       SysSecureLog(NID_WEB_CTRL, "The current value of url is %ls, tag is %ls, value is %ls", url.GetPointer(), tagName.GetPointer(), nodeValue.GetPointer());
 
        pHitElementResult = std::unique_ptr<HitElementResult>(new (std::nothrow) HitElementResult());
        SysTryCatch(NID_WEB_CTRL, pHitElementResult.get(), , E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
@@ -2696,18 +3049,6 @@ CATCH:
 }
 
 
-const HitElementResult*
-_WebImpl::GetElementByPointN(const FloatPoint& point) const
-{
-       const Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(point));
-
-       std::unique_ptr<const HitElementResult> pHitElementResult(GetElementByPointN(integerPoint));
-       SysTryReturn(NID_WEB_CTRL, pHitElementResult.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-       return pHitElementResult.release();
-}
-
-
 bool
 _WebImpl::IsLoading(void) const
 {
@@ -2736,7 +3077,7 @@ _WebImpl::IsPrivateBrowsingEnabled(void) const
 {
        if (__pWebCore->GetWebNativeNode() == null)
        {
-               return _WebSettingImpl::GetInstance(__pWebSetting.get())->IsPrivateBrowsingEnabled();
+               return _WebSettingImpl::GetInstance(__pWebCore->GetSetting())->IsPrivateBrowsingEnabled();
        }
 
        Ewk_Settings* pSettings = ewk_view_settings_get(__pWebCore->GetWebNativeNode());
@@ -2751,7 +3092,7 @@ _WebImpl::SetPrivateBrowsingEnabled(bool enable)
 {
        if (__pWebCore->GetWebNativeNode() == null)
        {
-               _WebSettingImpl::GetInstance(__pWebSetting.get())->SetPrivateBrowsingEnabled(enable);
+               _WebSettingImpl::GetInstance(__pWebCore->GetSetting())->SetPrivateBrowsingEnabled(enable);
                return;
        }
 
@@ -2815,7 +3156,7 @@ _WebImpl::IsCookieEnabled(void) const
 {
        if (__pWebCore->GetWebNativeNode() == null)
        {
-               return _WebSettingImpl::GetInstance(__pWebSetting.get())->IsCookieEnabled();
+               return _WebSettingImpl::GetInstance(__pWebCore->GetSetting())->IsCookieEnabled();
        }
 
        Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
@@ -2839,7 +3180,7 @@ _WebImpl::SetCookieEnabled(bool enable)
 {
        if (__pWebCore->GetWebNativeNode() == null)
        {
-               _WebSettingImpl::GetInstance(__pWebSetting.get())->SetCookiEnabled(enable);
+               _WebSettingImpl::GetInstance(__pWebCore->GetSetting())->SetCookiEnabled(enable);
 
                return;
        }
@@ -2850,7 +3191,7 @@ _WebImpl::SetCookieEnabled(bool enable)
 
        if (enable)
        {
-               ewk_cookie_manager_accept_policy_set(pCookieManager, EWK_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY);
+               ewk_cookie_manager_accept_policy_set(pCookieManager, EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
        }
        else
        {
@@ -2964,14 +3305,14 @@ _WebImpl::SetTextSearchListener(ITextSearchListener* pTextSearchListener)
 void
 _WebImpl::SetScrollEnabled(bool enable)
 {
-       _WebSettingImpl::GetInstance(__pWebSetting.get())->SetScrollEnabled(enable);
+       _WebSettingImpl::GetInstance(__pWebCore->GetSetting())->SetScrollEnabled(enable);
 }
 
 
 bool
 _WebImpl::IsScrollEnabled(void) const
 {
-       return _WebSettingImpl::GetInstance(__pWebSetting.get())->IsScrollEnabled();
+       return _WebSettingImpl::GetInstance(__pWebCore->GetSetting())->IsScrollEnabled();
 }
 
 
@@ -3093,88 +3434,99 @@ void
 _WebImpl::SetEventListenerCallback(void) const
 {
        Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
-       SysAssertf(pWebNativeNode, "Failed to get Web evas object");
+       if (pWebNativeNode)
+       {
+               _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+               SysAssertf(pEcoreEvas, "Failed to get Ui ecore evas");
 
-       _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-       SysAssertf(pEcoreEvas, "Failed to get Ui ecore evas");
+               Evas_Object* pWinObject = pEcoreEvas->GetWindowObject();
+               SysAssertf(pWinObject, "Failed to get Ui window evas object");
 
-       Evas_Object* pWinObject = pEcoreEvas->GetWindowObject();
-       SysAssertf(pWinObject, "Failed to get Ui window evas object");
+               Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
+               SysAssertf(pSmartData, "Failed to request");
 
-       Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
-       SysAssertf(pSmartData, "Failed to request");
+               Ewk_View_Smart_Class *pSmart = const_cast<Ewk_View_Smart_Class*>(pSmartData->api);
+               SysAssertf(pSmart, "Failed to request");
 
-       Ewk_View_Smart_Class *pSmart = const_cast<Ewk_View_Smart_Class*>(pSmartData->api);
-       SysAssertf(pSmart, "Failed to request");
+               pSmart->popup_menu_show = OnSelectBoxRequested;
+               pSmart->popup_menu_hide = OnSelectBoxClosed;
+               pSmart->popup_menu_update = OnSelectBoxUpdateRequested;
 
-       pSmart->popup_menu_show = OnSelectBoxRequested;
-       pSmart->popup_menu_hide = OnSelectBoxClosed;
-       pSmart->popup_menu_update = OnSelectBoxUpdateRequested;
+               pSmart->input_picker_show = OnDatePickerProviderRequested;
+               pSmart->input_picker_color_request = OnColorPickerProviderRequested;
+               pSmart->input_picker_color_dismiss = OnColorPickerProviderDismissed;
 
-       pSmart->input_picker_show = OnDatePickerProviderRequested;
-       pSmart->input_picker_color_request = OnColorPickerProviderRequested;
-       pSmart->input_picker_color_dismiss = OnColorPickerProviderDismissed;
+               evas_object_data_set(pWebNativeNode, WEB_CTRL, this);
 
-       evas_object_data_set(pWebNativeNode, WEB_CTRL, this);
+               // add loading event callbacks for ILoadingListener
+               evas_object_smart_callback_add(pWebNativeNode, "create,window", OnWebWindowCreateRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "close,window", OnWebWindowClosedRequested, this);
 
-       // add loading event callbacks for ILoadingListener
-       evas_object_smart_callback_add(pWebNativeNode, "create,window", OnWebWindowCreateRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "close,window", OnWebWindowClosedRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "policy,navigation,decide", OnLoadingRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,started", OnLoadingStarted, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,finished", OnLoadingCompleted, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,progress", OnEstimatedProgress, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,progress,finished", OnProgressCompleted, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,stop", OnLoadingCanceled, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,error", OnLoadingErrorOccurred, this);
+               evas_object_smart_callback_add(pWebNativeNode, "title,changed", OnPageTitleReceived, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,committed", OnLoadingCommitted, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "policy,navigation,decide", OnLoadingRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "load,started", OnLoadingStarted, this);
-       evas_object_smart_callback_add(pWebNativeNode, "load,finished", OnLoadingCompleted, this);
-       evas_object_smart_callback_add(pWebNativeNode, "load,progress", OnEstimatedProgress, this);
-       evas_object_smart_callback_add(pWebNativeNode, "load,progress,finished", OnProgressCompleted, this);
-       evas_object_smart_callback_add(pWebNativeNode, "load,stop", OnLoadingCanceled, this);
-       evas_object_smart_callback_add(pWebNativeNode, "load,error", OnLoadingErrorOccurred, this);
-       evas_object_smart_callback_add(pWebNativeNode, "title,changed", OnPageTitleReceived, this);
-       evas_object_smart_callback_add(pWebNativeNode, "load,committed", OnLoadingCommitted, this);
+               evas_object_smart_callback_add(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest, this);
+               evas_object_smart_callback_add(pWinObject, "focus,in", OnWindowObjectFocusGained, this);
 
-       evas_object_smart_callback_add(pWinObject, "focus,in", OnWindowObjectFocusGained, this);
+               evas_object_smart_callback_add(pWebNativeNode, "inputmethod,changed", OnWebKeypadStateChanged, this);
+               evas_object_smart_callback_add(pWebNativeNode, "editorclient,ime,opened", OnWebKeypadOpened, this);
+               evas_object_smart_callback_add(pWebNativeNode, "editorclient,ime,closed", OnWebKeypadClosed, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "inputmethod,changed", OnWebKeypadStateChanged, this);
-       evas_object_smart_callback_add(pWebNativeNode, "editorclient,ime,opened", OnWebKeypadOpened, this);
-       evas_object_smart_callback_add(pWebNativeNode, "editorclient,ime,closed", OnWebKeypadClosed, this);
+               evas_object_smart_callback_add(pWebNativeNode, "authentication,challenge", OnHttpAuthenticationRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "authentication,canceled", OnHttpAuthenticationCanceled, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "authentication,challenge", OnHttpAuthenticationRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "authentication,canceled", OnHttpAuthenticationCanceled, this);
+               evas_object_smart_callback_add(pWebNativeNode, "geolocation,permission,request", OnGeolocationPermissionRequested, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "geolocation,permission,request", OnGeolocationPermissionRequested, this);
+               ewk_view_javascript_alert_callback_set(pWebNativeNode, OnScriptAlertRequested, const_cast< _WebImpl* >(this));
+               ewk_view_javascript_prompt_callback_set(pWebNativeNode, OnScriptPromptRequested, const_cast< _WebImpl* >(this));
+               ewk_view_javascript_confirm_callback_set(pWebNativeNode, OnScriptConfirmRequested, const_cast< _WebImpl* >(this));
 
-       ewk_view_javascript_alert_callback_set(pWebNativeNode, OnScriptAlertRequested, const_cast< _WebImpl* >(this));
-       ewk_view_javascript_prompt_callback_set(pWebNativeNode, OnScriptPromptRequested, const_cast< _WebImpl* >(this));
-       ewk_view_javascript_confirm_callback_set(pWebNativeNode, OnScriptConfirmRequested, const_cast< _WebImpl* >(this));
+               evas_object_smart_callback_add(pWebNativeNode, "policy,response,decide", OnWebDataReceived, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "policy,response,decide", OnWebDataReceived, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted, this);
+               evas_object_smart_callback_add(pWebNativeNode, "notification,permission,request", OnNotificationPermissionRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "notification,show", OnNotificationShow, this);
+               evas_object_smart_callback_add(pWebNativeNode, "notification,cancel", OnNotificationCancel, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "notification,permission,request", OnNotificationPermissionRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "notification,show", OnNotificationShow, this);
-       evas_object_smart_callback_add(pWebNativeNode, "notification,cancel", OnNotificationCancel, this);
+               evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,registration,requested", OnProtocolHandlerRegistrationRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,isregistered", OnIsProtocolHandlerRegistered, this);
+               evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,unregistration,requested", OnProtocolHandlerUnregistrationRequested, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,registration,requested", OnProtocolHandlerRegistrationRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,isregistered", OnIsProtocolHandlerRegistered, this);
-       evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,unregistration,requested", OnProtocolHandlerUnregistrationRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "contenthandler,registration,requested", OnContentHandlerRegistrationRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "contenthandler,isregistered", OnIsContentHandlerRegistered, this);
+               evas_object_smart_callback_add(pWebNativeNode, "contenthandler,unregistration,requested", OnContentHandlerUnregistrationRequested, this);
+               evas_object_smart_callback_add(pWebNativeNode, "text,found", OnTextFound, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "contenthandler,registration,requested", OnContentHandlerRegistrationRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "contenthandler,isregistered", OnIsContentHandlerRegistered, this);
-       evas_object_smart_callback_add(pWebNativeNode, "contenthandler,unregistration,requested", OnContentHandlerUnregistrationRequested, this);
-       evas_object_smart_callback_add(pWebNativeNode, "text,found", OnTextFound, this);
+               evas_object_smart_callback_add(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered, this);
+               evas_object_smart_callback_add(pWebNativeNode, "icon,received", OnFaviconReceived, this);
 
-       evas_object_smart_callback_add(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered, this);
+               evas_object_smart_callback_add(pWebNativeNode, "text,style,state", OnWebPageBlockSelected, this);
+               evas_object_smart_callback_add(pWebNativeNode, "frame,rendered", OnWebPageBlockSelectedByOrientation, this);
 
-       Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
-       SysAssertf(pContext, "Failed to get webkit instance.");
-       ewk_context_did_start_download_callback_set(pContext, OnDidStartDownloadCallback, const_cast< _WebImpl* >(this));
-       ewk_view_open_panel_callback_set(pWebNativeNode, OnSelectUploadFile, const_cast< _WebImpl* >(this));
+               ewk_view_open_panel_callback_set(pWebNativeNode, OnSelectUploadFile, const_cast< _WebImpl* >(this));
+               Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
+               SysAssertf(pContext, "Failed to get webkit instance.");
+               ewk_context_did_start_download_callback_set(pContext, OnDidStartDownloadCallback, const_cast< _WebImpl* >(this));
+               ewk_context_vibration_client_callbacks_set(pContext, OnVibrationRequested, OnVibrationCanceled, const_cast< _WebImpl* >(this));
+
+               ewk_view_application_cache_permission_callback_set(pWebNativeNode, OnApplicationCachePermissionRequested, const_cast< _WebImpl* >(this));
+               ewk_view_exceeded_indexed_database_quota_callback_set(pWebNativeNode, OnIndexedDatabaseQuotaExceeded, const_cast< _WebImpl* >(this));
+               ewk_view_exceeded_database_quota_callback_set(pWebNativeNode, OnDatabaseQuotaExceeded, const_cast< _WebImpl* >(this));
+               ewk_view_exceeded_local_file_system_quota_callback_set(pWebNativeNode, OnLocalFileSystemQuotaExceeded, const_cast< _WebImpl* >(this));
 
-       evas_object_event_callback_add(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained, this);
+               evas_object_event_callback_add(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained, this);
+       }
 }
 
 
@@ -3182,203 +3534,148 @@ void
 _WebImpl::RemoveEventListenerCallback(void) const
 {
        Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
-       SysTryReturnVoidResult(NID_WEB_CTRL, pWebNativeNode, E_SYSTEM, "[%s] Failed to get Web evas object.", GetErrorMessage(E_SYSTEM));
-
-       _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-       SysAssertf(pEcoreEvas, "Failed to get Ui ecore evas");
-
-       Evas_Object* pWinObject = pEcoreEvas->GetWindowObject();
-       SysAssertf(pWinObject, "Failed to get Ui window evas object");
-
-       evas_object_smart_callback_del(pWebNativeNode, "create,window", OnWebWindowCreateRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "close,window", OnWebWindowClosedRequested);
-
-       evas_object_smart_callback_del(pWebNativeNode, "policy,navigation,decide", OnLoadingRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "load,started", OnLoadingStarted);
-       evas_object_smart_callback_del(pWebNativeNode, "load,finished", OnLoadingCompleted);
-       evas_object_smart_callback_del(pWebNativeNode, "load,progress", OnEstimatedProgress);
-       evas_object_smart_callback_del(pWebNativeNode, "load,progress,finished", OnProgressCompleted);
-       evas_object_smart_callback_del(pWebNativeNode, "load,stop", OnLoadingCanceled);
-       evas_object_smart_callback_del(pWebNativeNode, "load,error", OnLoadingErrorOccurred);
-       evas_object_smart_callback_del(pWebNativeNode, "title,changed", OnPageTitleReceived);
-
-       evas_object_smart_callback_del(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest);
-
-       evas_object_smart_callback_del(pWinObject, "focus,in", OnWindowObjectFocusGained);
-
-       evas_object_smart_callback_del(pWebNativeNode, "inputmethod,changed", OnWebKeypadStateChanged);
-       evas_object_smart_callback_del(pWebNativeNode, "editorclient,ime,opened", OnWebKeypadOpened);
-       evas_object_smart_callback_del(pWebNativeNode, "editorclient,ime,closed", OnWebKeypadClosed);
-
-       evas_object_smart_callback_del(pWebNativeNode, "authentication,challenge", OnHttpAuthenticationRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "authentication,canceled", OnHttpAuthenticationCanceled);
-
-       evas_object_smart_callback_del(pWebNativeNode, "geolocation,permission,request", OnGeolocationPermissionRequested);
-
-       ewk_view_javascript_alert_callback_set(null, null, null);
-       ewk_view_javascript_prompt_callback_set(null, null, null);
-       ewk_view_javascript_confirm_callback_set(null, null, null);
-
-       evas_object_smart_callback_del(pWebNativeNode, "policy,response,decide", OnWebDataReceived);
-
-       evas_object_smart_callback_del(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted);
-
-       evas_object_smart_callback_del(pWebNativeNode, "notification,permission,request", OnNotificationPermissionRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "notification,show", OnNotificationShow);
-       evas_object_smart_callback_del(pWebNativeNode, "notification,cancel", OnNotificationCancel);
-       evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,registration,requested", OnProtocolHandlerRegistrationRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,isregistered", OnIsProtocolHandlerRegistered);
-       evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,unregistration,requested", OnProtocolHandlerUnregistrationRequested);
-
-       evas_object_smart_callback_del(pWebNativeNode, "contenthandler,registration,requested", OnContentHandlerRegistrationRequested);
-       evas_object_smart_callback_del(pWebNativeNode, "contenthandler,isregistered", OnIsContentHandlerRegistered);
-       evas_object_smart_callback_del(pWebNativeNode, "contenthandler,unregistration,requested", OnContentHandlerUnregistrationRequested);
-
-       evas_object_smart_callback_del(pWebNativeNode, "text,found", OnTextFound);
-
-       evas_object_smart_callback_del(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered);
-
-       ewk_view_open_panel_callback_set(null, null, null);
-
-       evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained);
-}
-
-
-result
-_WebImpl::SetBlockSelectionPosition(const Point& startPoint)
-{
-       Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
-
-       Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
-       SysAssertf(pSmartData, "Failed to request");
-
-       Point absPoint(__pWebCore->GetAbsoluteCoordinate(startPoint));
-
-       pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
-       pSmartData->api->text_selection_up(pSmartData, absPoint.x, absPoint.y);
-
-       ewk_view_command_execute(pWebNativeNode, "SelectWord", 0);
+       if (pWebNativeNode)
+       {
+               _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+               SysAssertf(pEcoreEvas, "Failed to get Ui ecore evas");
 
-       SysTryReturnResult(NID_WEB_CTRL, GetTextFromBlock().GetLength() > 0, E_INVALID_ARG, "Failed to set text selection up.");
+               Evas_Object* pWinObject = pEcoreEvas->GetWindowObject();
+               SysAssertf(pWinObject, "Failed to get Ui window evas object");
 
-       if (__pUserUiListener)
-       {
-               FireWebPageBlockSelectedEvent();
-       }
+               evas_object_smart_callback_del(pWebNativeNode, "create,window", OnWebWindowCreateRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "close,window", OnWebWindowClosedRequested);
 
-       return E_SUCCESS;
-}
+               evas_object_smart_callback_del(pWebNativeNode, "policy,navigation,decide", OnLoadingRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "load,started", OnLoadingStarted);
+               evas_object_smart_callback_del(pWebNativeNode, "load,finished", OnLoadingCompleted);
+               evas_object_smart_callback_del(pWebNativeNode, "load,progress", OnEstimatedProgress);
+               evas_object_smart_callback_del(pWebNativeNode, "load,progress,finished", OnProgressCompleted);
+               evas_object_smart_callback_del(pWebNativeNode, "load,stop", OnLoadingCanceled);
+               evas_object_smart_callback_del(pWebNativeNode, "load,error", OnLoadingErrorOccurred);
+               evas_object_smart_callback_del(pWebNativeNode, "title,changed", OnPageTitleReceived);
 
+               evas_object_smart_callback_del(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest);
 
-result
-_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
-{
-       Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
+               evas_object_smart_callback_del_full(pWinObject, "focus,in", OnWindowObjectFocusGained, this);
 
-       Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
-       SysAssertf(pSmartData, "Failed to request");
+               evas_object_smart_callback_del(pWebNativeNode, "inputmethod,changed", OnWebKeypadStateChanged);
+               evas_object_smart_callback_del(pWebNativeNode, "editorclient,ime,opened", OnWebKeypadOpened);
+               evas_object_smart_callback_del(pWebNativeNode, "editorclient,ime,closed", OnWebKeypadClosed);
 
-       Point absPoint(__pWebCore->GetAbsoluteCoordinate(_CoordinateSystemUtils::ConvertToInteger(startPoint)));
+               evas_object_smart_callback_del(pWebNativeNode, "authentication,challenge", OnHttpAuthenticationRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "authentication,canceled", OnHttpAuthenticationCanceled);
 
-       pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
-       pSmartData->api->text_selection_up(pSmartData, absPoint.x, absPoint.y);
+               evas_object_smart_callback_del(pWebNativeNode, "geolocation,permission,request", OnGeolocationPermissionRequested);
 
-       ewk_view_command_execute(pWebNativeNode, "SelectWord", 0);
+               ewk_view_javascript_alert_callback_set(null, null, null);
+               ewk_view_javascript_prompt_callback_set(null, null, null);
+               ewk_view_javascript_confirm_callback_set(null, null, null);
 
-       SysTryReturnResult(NID_WEB_CTRL, GetTextFromBlock().GetLength() > 0, E_INVALID_ARG, "Failed to set text selection up.");
+               evas_object_smart_callback_del(pWebNativeNode, "policy,response,decide", OnWebDataReceived);
 
-       if (__pUserUiListenerF)
-       {
-               FireWebPageBlockSelectedEventF();
-       }
+               evas_object_smart_callback_del(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted);
 
-       return E_SUCCESS;
-}
+               evas_object_smart_callback_del(pWebNativeNode, "notification,permission,request", OnNotificationPermissionRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "notification,show", OnNotificationShow);
+               evas_object_smart_callback_del(pWebNativeNode, "notification,cancel", OnNotificationCancel);
+               evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,registration,requested", OnProtocolHandlerRegistrationRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,isregistered", OnIsProtocolHandlerRegistered);
+               evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,unregistration,requested", OnProtocolHandlerUnregistrationRequested);
 
+               evas_object_smart_callback_del(pWebNativeNode, "contenthandler,registration,requested", OnContentHandlerRegistrationRequested);
+               evas_object_smart_callback_del(pWebNativeNode, "contenthandler,isregistered", OnIsContentHandlerRegistered);
+               evas_object_smart_callback_del(pWebNativeNode, "contenthandler,unregistration,requested", OnContentHandlerUnregistrationRequested);
 
-void
-_WebImpl::FireWebPageBlockSelectedEvent(void) const
-{
-       result r = E_SUCCESS;
+               evas_object_smart_callback_del(pWebNativeNode, "text,found", OnTextFound);
 
-       std::unique_ptr<Point> startPoint(new (std::nothrow) Point());
-       std::unique_ptr<Point> endPoint(new (std::nothrow) Point());
-       SysTryReturnVoidResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+               evas_object_smart_callback_del(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered);
+               evas_object_smart_callback_del(pWebNativeNode, "icon,received", OnFaviconReceived);
 
-       GetBlockRange(*startPoint.get(), *endPoint.get());
+               evas_object_smart_callback_del(pWebNativeNode, "text,style,state", OnWebPageBlockSelected);
+               evas_object_smart_callback_del(pWebNativeNode, "frame,rendered", OnWebPageBlockSelectedByOrientation);
 
-       std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED));
-       SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+               ewk_view_open_panel_callback_set(null, null, null);
+               Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
+               SysAssertf(pContext, "Failed to get webkit instance.");
+               ewk_context_vibration_client_callbacks_set(pContext, null, null, null);
 
-       r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
-       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-       startPoint.release();
+               ewk_view_application_cache_permission_callback_set(pWebNativeNode, null, null);
+               ewk_view_exceeded_indexed_database_quota_callback_set(pWebNativeNode, null, null);
+               ewk_view_exceeded_database_quota_callback_set(pWebNativeNode, null, null);
+               ewk_view_exceeded_local_file_system_quota_callback_set(pWebNativeNode, null, null);
 
-       r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
-       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-       endPoint.release();
+               evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained);
+       }
+}
 
-       r = __pWebEvent->FireAsync(*pEventArg.get());
-       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-       pEventArg.release();
+
+result
+_WebImpl::SetBlockSelectionPosition(const Point& startPoint)
+{
+       return SetBlockSelectionPosition(_CoordinateSystemUtils::ConvertToFloat(startPoint));
 }
 
 
-void
-_WebImpl::FireWebPageBlockSelectedEventF(void) const
+result
+_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
 {
-       result r = E_SUCCESS;
+       Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
 
-       std::unique_ptr<FloatPoint> startPoint(new (std::nothrow) FloatPoint());
-       std::unique_ptr<FloatPoint> endPoint(new (std::nothrow) FloatPoint());
-       SysTryReturnVoidResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+       Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
+       SysAssertf(pSmartData, "Failed to request");
 
-       GetBlockRange(*startPoint.get(), *endPoint.get());
+       Point absPoint( _CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(startPoint)));
 
-       std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED_FLOAT));
-       SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+       Eina_Bool ret = pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
+       if (ret)
+       {
+               pSmartData->api->text_selection_up(pSmartData, absPoint.x, absPoint.y);
 
-       r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
-       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-       startPoint.release();
+               Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(__pWebCore->GetWebNativeNode(), absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL);
+               SysTryReturnResult(NID_WEB_CTRL, pEwkHitTest, E_SYSTEM, "Failed to get hit test.");
 
-       r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
-       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-       endPoint.release();
+               String tagName(ewk_hit_test_tag_name_get(pEwkHitTest));
 
-       r = __pWebEvent->FireAsync(*pEventArg.get());
-       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-       pEventArg.release();
+               if (tagName.Equals(L"INPUT", false) || tagName.Equals(L"TEXTAREA", false))
+               {
+                       ewk_view_command_execute(pWebNativeNode, "SelectWord", 0);
+               }
+               else
+               {
+                       Eina_Hash* pAttrHash = ewk_hit_test_attribute_hash_get(pEwkHitTest);
+                       char* pValue = reinterpret_cast< char* >(eina_hash_find(pAttrHash, "contenteditable"));
+                       if(pValue)
+                       {
+                               ewk_view_command_execute(pWebNativeNode, "SelectWord", 0);
+                       }
+               }
+       }
+
+       SysTryReturnResult(NID_WEB_CTRL, GetTextFromBlock().GetLength() > 0, E_INVALID_ARG, "Failed to set text selection up.");
+
+       return E_SUCCESS;
 }
 
 
 void
 _WebImpl::ReleaseBlock(void)
 {
-       ewk_view_command_execute(__pWebCore->GetWebNativeNode(), "Unselect", 0);
+       ewk_view_text_selection_range_clear(__pWebCore->GetWebNativeNode());
 }
 
 
 void
 _WebImpl::GetBlockRange(Point& startPoint, Point& endPoint) const
 {
-       Eina_Rectangle leftHandle;
-       Eina_Rectangle rightHandle;
+       FloatPoint tempStartPoint;
+       FloatPoint tempEndPoint;
 
-       ewk_view_text_selection_range_get(__pWebCore->GetWebNativeNode(), &leftHandle, &rightHandle);
-
-       startPoint.x = leftHandle.x;
-       startPoint.y = leftHandle.y;
-       endPoint.x = rightHandle.x + rightHandle.w;
-       endPoint.y = rightHandle.y + rightHandle.h;
+       GetBlockRange(tempStartPoint, tempEndPoint);
 
-       if ((endPoint.x != 0) && (endPoint.y != 0))
-       {
-               startPoint = __pWebCore->GetRelativeCoordinate(startPoint);
-               endPoint = __pWebCore->GetRelativeCoordinate(endPoint);
-       }
+       startPoint = _CoordinateSystemUtils::ConvertToInteger(tempStartPoint);
+       endPoint = _CoordinateSystemUtils::ConvertToInteger(tempEndPoint);
 }
 
 
@@ -3395,7 +3692,7 @@ _WebImpl::GetBlockRange(FloatPoint& startPoint, FloatPoint& endPoint) const
        endPoint.x = _CoordinateSystemUtils::ConvertToFloat(rightHandle.x + rightHandle.w);
        endPoint.y = _CoordinateSystemUtils::ConvertToFloat(rightHandle.y + rightHandle.h);
 
-       if ((endPoint.x != 0) && (endPoint.y != 0))
+       if ((endPoint.x != 0.0f) && (endPoint.y != 0.0f))
        {
                startPoint = __pWebCore->GetRelativeCoordinate(startPoint);
                endPoint = __pWebCore->GetRelativeCoordinate(endPoint);
@@ -3422,10 +3719,13 @@ _WebImpl::GetFaviconN(void) const
        std::unique_ptr<Bitmap> pBitmapImage(new (std::nothrow) Bitmap());
        SysTryReturn(NID_WEB_CTRL, pBitmapImage.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       Evas_Object* pfavicon = ewk_context_icon_database_icon_object_add(pContext, pUrl, pEvas);
-       SysTryReturn(NID_WEB_CTRL, pfavicon, null, E_OBJ_NOT_FOUND, "[%s] Propagating.", GetErrorMessage(E_OBJ_NOT_FOUND));
+       Evas_Object* pFavicon = ewk_context_icon_database_icon_object_add(pContext, pUrl, pEvas);
+       if (!pFavicon)
+       {
+               return null;
+       }
 
-       r = _Utility::GetPixelBufferFromEvasObject(pfavicon,  bufferInfo);
+       r = _Utility::GetPixelBufferFromEvasObject(pFavicon,  bufferInfo);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
        const Dimension dimension(bufferInfo.width, bufferInfo.height);
@@ -3522,6 +3822,41 @@ _WebImpl::GetPolicyDecision(void) const
 }
 
 
+void
+_WebImpl::SetCertificateRequested(bool arg)
+{
+       __isCertificateRequested = arg;
+}
+
+
+bool
+_WebImpl::IsCertificateRequested(void) const
+{
+       return __isCertificateRequested;
+}
+
+
+bool
+_WebImpl::IsCertificateConfirmed(void) const
+{
+       return __isCertificateConfirmed;
+}
+
+
+void
+_WebImpl::SetOrientationChanged(bool arg)
+{
+       __isOrientationChanged = arg;
+}
+
+
+bool
+_WebImpl::IsOrientationChanged(void) const
+{
+       return __isOrientationChanged;
+}
+
+
 result
 _WebImpl::LaunchAppControl(const IEventArg& arg)
 {
@@ -3790,6 +4125,18 @@ _WebImpl::OnHandleLoadingEvent(const IEventArg& arg)
                break;
        }
 
+       case WEB_EVENT_LOADINGLISTENER_FAVICON_RECEIVED:
+       {
+               std::unique_ptr<Bitmap> pFavicon(GetFaviconN());
+               SysTryReturn(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+               if (pFavicon.get())
+               {
+                       pLoadingListner->OnFaviconReceived(*pFavicon.get());
+               }
+               break;
+       }
+
        default:
        {
                SysAssert(false);
@@ -3854,8 +4201,6 @@ _WebImpl::OnHandleWebDownloadEvent(const IEventArg& arg)
 result
 _WebImpl::OnHandleWebUiEvent(const IEventArg& arg)
 {
-       result r = E_SUCCESS;
-
        const _WebUiEventArg* pEventArg = dynamic_cast< const _WebUiEventArg* >(&arg);
        SysTryReturnResult(NID_WEB_CTRL, pEventArg, E_INVALID_ARG, "Invalid argument(s) is used. Type casting failed. argument must be IEventArg type.");
 
@@ -3919,8 +4264,6 @@ _WebImpl::OnHandleWebUiEvent(const IEventArg& arg)
 result
 _WebImpl::OnHandleWebUiEventF(const IEventArg& arg)
 {
-       result r = E_SUCCESS;
-
        const _WebUiEventArg* pEventArg = dynamic_cast< const _WebUiEventArg* >(&arg);
        SysTryReturnResult(NID_WEB_CTRL, pEventArg, E_INVALID_ARG, "Invalid argument(s) is used. Type casting failed. argument must be IEventArg type.");
 
@@ -4019,6 +4362,37 @@ _WebImpl::OnHandleTextSearchEvent(const IEventArg& arg)
 
 
 result
+_WebImpl::VibrationRequested(uint64_t duration)
+{
+       result r = E_SUCCESS;
+
+       __pVibrator.reset();
+
+       std::unique_ptr<_VibratorImpl> pVibrator(new (std::nothrow) _VibratorImpl);
+       SysTryReturnResult(NID_WEB_CTRL, pVibrator.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = pVibrator->Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       __pVibrator = std::move(pVibrator);
+
+       IntensityDurationVibrationPattern pattern = {static_cast< int >(duration), -1};
+
+       r = __pVibrator->Start(&pattern, 1, 1);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return E_SUCCESS;
+}
+
+
+void
+_WebImpl::VibrationCanceled(void)
+{
+       __pVibrator.reset();
+}
+
+
+result
 _WebImpl::HttpAuthenticationRequested(Ewk_Auth_Challenge* pChallenge)
 {
        result r = E_SUCCESS;
@@ -4068,6 +4442,9 @@ _WebImpl::ShowAuthenticationPopup(const String& host, const String& realm, Authe
        __pAuthPopup = std::move(pAuthPopup);
 
        int modalResult = 0;
+
+       __pAuthPopup->SetOwner(&GetPublic());
+       
        r = __pAuthPopup->ShowAndWait(modalResult);
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -4079,45 +4456,77 @@ CATCH:
 
 
 result
-_WebImpl::ShowGeolocationPopup(Ewk_Geolocation_Permission_Request* pPermissionRequest)
+_WebImpl::ShowCertificateConfirmPopup(_CertificatePopupMode userConfirmMode, Ewk_Certificate_Policy_Decision* pPolicy)
 {
        result r = E_SUCCESS;
 
-       std::unique_ptr<_GeolocationConfirmPopup> pGeolocationPopup(new (std::nothrow) _GeolocationConfirmPopup());
-       SysTryReturnResult(NID_WEB_CTRL, pGeolocationPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+       std::unique_ptr<_CertificateConfirmPopup> pCertConfirmPopup(new (std::nothrow) _CertificateConfirmPopup());
+       SysTryReturnResult(NID_WEB_CTRL, pCertConfirmPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
-       r = pGeolocationPopup->Construct(pPermissionRequest);
+       r = pCertConfirmPopup->Construct(userConfirmMode, pPolicy);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       __pGeolocationPopup = std::move(pGeolocationPopup);
+       __pCertConfirmPopup = std::move(pCertConfirmPopup);
 
-       r = __pGeolocationPopup->ShowPopup();
-       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       int modalResult = 0;
 
-       __pGeolocationPopup.release();
+       __pCertConfirmPopup->SetOwner(&GetPublic());
+       
+       r = __pCertConfirmPopup->ShowAndWait(modalResult);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       return E_SUCCESS;
+       if (userConfirmMode == CERTIFICATE_POPUP_MODE_USER_CONFIRM)
+       {
+               __isCertificateConfirmed = __pCertConfirmPopup->GetConfirmResult();
+       }
 
 CATCH:
-       __pGeolocationPopup.reset();
+       __pCertConfirmPopup.reset();
 
        return r;
 }
 
+result
+_WebImpl::ShowUserConfirmPopup(_UserConfirmMode userConfirmMode, void* pPolicy, String msg)
+{
+       result r = E_SUCCESS;
+
+       std::unique_ptr<_UserConfirmPopup> pUserConfirmPopup(new (std::nothrow) _UserConfirmPopup());
+       SysTryReturnResult(NID_WEB_CTRL, pUserConfirmPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+       r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, true, msg);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       __pUserConfirmPopup = std::move(pUserConfirmPopup);
+
+       int modalResult = 0;
+
+       __pUserConfirmPopup->SetOwner(&GetPublic());
+       
+       r = __pUserConfirmPopup->ShowAndWait(modalResult);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       
+CATCH:
+       __pUserConfirmPopup.reset();
+
+       return r;
+}
 
 result
-_WebImpl::ShowUserConfirmPopup(_UserConfirmMode userConfirmMode, void* pPolicy)
+_WebImpl::ShowUserConfirmPopupAsync(_UserConfirmMode userConfirmMode, void* pPolicy, String msg)
 {
        result r = E_SUCCESS;
 
        std::unique_ptr<_UserConfirmPopup> pUserConfirmPopup(new (std::nothrow) _UserConfirmPopup());
        SysTryReturnResult(NID_WEB_CTRL, pUserConfirmPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
-       r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy);
+       r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, false, msg);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pUserConfirmPopup = std::move(pUserConfirmPopup);
 
+       __pUserConfirmPopup->SetOwner(&GetPublic());
+
        r = __pUserConfirmPopup->ShowPopup();
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -4139,24 +4548,13 @@ _WebImpl::GetParentFormCore(_Control* pControlCore)
        _Form* pFormCore = null;
 
        _Control* pParentControlCore = dynamic_cast< _Control* >(pControlCore->GetParent());
-
-       if (pParentControlCore == null)
-       {
-               _Window* pWindowCore = dynamic_cast< _Window* >(pControlCore);
-               SysAssertf(pWindowCore, "Failed to get parent control and window core.");
-               pFormCore = dynamic_cast< _Form* >(pWindowCore->GetOwner());
-               if (pFormCore == null)
-               {
-                       pParentControlCore = dynamic_cast< _Control* >(pWindowCore->GetOwner());
-                       SysTryReturn(NID_WEB_CTRL, pParentControlCore, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-               }
-       }
-       else
+       if (!pParentControlCore)
        {
-               pFormCore = dynamic_cast< _Form* >(pParentControlCore);
+               return null;
        }
 
-       if (pFormCore != null)
+       pFormCore = dynamic_cast< _Form* >(pParentControlCore);
+       if (pFormCore)
        {
                return pFormCore;
        }
@@ -4178,6 +4576,8 @@ _WebImpl::OnFocusLost(const _ControlImpl& source)
        if(IsKeypadVisible() == true)
        {
                SetKeypadOpened(true);
+
+               SetKeypadVisibleState(false);
        }
 
        evas_object_focus_set(__pWebCore->GetWebNativeNode(), EINA_FALSE);
@@ -4199,7 +4599,7 @@ _WebImpl::HasValidNativeNode(void) const
 
 
 result
-_WebImpl::OnAttachedToMainTree(void)
+_WebImpl::OnPreAttachedToMainTree(void)
 {
        result r = E_SUCCESS;
 
@@ -4209,7 +4609,7 @@ _WebImpl::OnAttachedToMainTree(void)
        r = InitializeSetting();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = _ContainerImpl::OnAttachedToMainTree();
+       r = _ContainerImpl::OnPreAttachedToMainTree();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return E_SUCCESS;
@@ -4221,24 +4621,12 @@ _WebImpl::OnChangeLayout(_ControlOrientation orientation)
 {
        _ContainerImpl::OnChangeLayout(orientation);
 
-       if (IsKeypadVisible() == true)
-       {
-               int x = 0;
-               int y = 0;
-               int w = 0;
-               int h = 0;
-               ecore_imf_context_input_panel_geometry_get(ecore_imf_context_add(ecore_imf_context_default_id_get()), &x, &y, &w, &h);
-
-               _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-               pFormCore->DeflateClientRectHeight(h);
-       }
-
        if (__pColorPicker.get())
        {
                __pColorPicker->ChangeLayout(orientation);
        }
+
+       __isOrientationChanged = true;
 }
 
 
@@ -4282,7 +4670,7 @@ _WebImpl::ShowColorPicker(int red, int green, int blue, int alpha, Color& color)
 
        Tizen::Graphics::Color colorVal(static_cast< byte >(red), static_cast< byte >(green), static_cast< byte >(blue), static_cast< byte >(alpha));
 
-       r = pColorHadler->Construct(colorVal);
+       r = pColorHadler->Construct(colorVal, this);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pColorPicker = std::move(pColorHadler);
@@ -4309,7 +4697,7 @@ _WebImpl::ShowDatePicker(Ewk_Input_Type inputType, const char* inputValue, Strin
        std::unique_ptr<_InputPickerPopup> pInputPicker(new (std::nothrow) _InputPickerPopup());
        SysTryReturnResult(NID_WEB_CTRL, pInputPicker.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       r = pInputPicker->Construct(String(inputValue), inputType);
+       r = pInputPicker->Construct(String(inputValue), inputType, this);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pDatePicker = std::move(pInputPicker);
@@ -4340,4 +4728,238 @@ _WebImpl::GetInstance(const Web* pWeb)
 }
 
 
+int 
+_WebImpl::SearchHandler(Ewk_Custom_Handlers_Data* pHandlerData, bool checkmime)
+{
+       int checkReturn = 0;
+       _DatabaseImpl db;
+       String handlerPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+
+       String table;
+       if( checkmime == true)
+       {
+               table = CUSTOM_CONTENT_TABLE_NAME;
+       }
+       else
+       {
+               table = CUSTOM_PROTOCOL_TABLE_NAME;
+       }
+       
+       String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
+       String uri(ewk_custom_handlers_data_url_get(pHandlerData));
+       String target(ewk_custom_handlers_data_target_get(pHandlerData));
+
+       SysSecureLog(NID_WEB_CTRL, "BaseUrl : %s, Url : %s, mime : %s", baseUri.GetPointer(), uri.GetPointer(), target.GetPointer());
+       
+       result r = db.Construct(handlerPath, "r+", null);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select allow From " + table + L" Where baseUrl = '" + baseUri + L"' AND url = '" + uri + L"' AND mime = '" + target + L"'"));
+       SysTryReturn(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, -1, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       if(pEnum.get())
+       {
+               r = pEnum->MoveNext();
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
+               r = pEnum->GetIntAt(0, checkReturn);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       else
+       {
+               checkReturn = 2;
+       }
+
+       return checkReturn;
+}
+
+
+result 
+_WebImpl::UnregistrationHandler(Ewk_Custom_Handlers_Data* pHandlerData, bool checkmime)
+{
+       int checkId = 0;
+       _DatabaseImpl db;
+       String handlerPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+
+       String table;
+       if( checkmime == true)
+       {
+               table = CUSTOM_CONTENT_TABLE_NAME;
+       }
+       else
+       {
+               table = CUSTOM_PROTOCOL_TABLE_NAME;
+       }
+
+       String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
+       String uri(ewk_custom_handlers_data_url_get(pHandlerData));
+       String target(ewk_custom_handlers_data_target_get(pHandlerData));
+       
+       SysSecureLog(NID_WEB_CTRL, "BaseUrl : %s, Url : %s, mime : %s", baseUri.GetPointer(), uri.GetPointer(), target.GetPointer());
+       
+       result r = db.Construct(handlerPath, "r+", null);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select id From " + table + L" Where baseUrl = '" + baseUri + L"' AND url = '" + uri + L"' AND mime = '" + target + L"'"));
+       SysTryReturn(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       if(pEnum.get())
+       {
+               r = pEnum->MoveNext();
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               r = pEnum->GetIntAt(0, checkId);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               
+               std::unique_ptr<DbStatement> pDeleteStmt(db.CreateStatementN(L"Delete From " + table + L" Where id = (?)"));
+               SysTryReturn(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+               r = pDeleteStmt->BindInt(0, checkId);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+               
+               db.BeginTransaction();
+               
+               std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pDeleteStmt));
+               
+               db.CommitTransaction();
+       }
+
+       return E_SUCCESS;
+}
+
+
+const Tizen::Base::String 
+_WebImpl::GetProtocolFromUri(const Tizen::Base::String& originUri, const Tizen::Base::String& currentUri)
+{
+       if (originUri == L"" || currentUri == L"")
+       {
+               return L"";
+       }
+
+       result r = E_SUCCESS;
+       String baseUri;
+       _DatabaseImpl db;
+       String handlerPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+       String originReplace(originUri);
+       String table(CUSTOM_PROTOCOL_TABLE_NAME);
+       int found = 0;
+       int foundQuery = 0;
+
+       r = currentUri.LastIndexOf(L"/", currentUri.GetLength()-1, found);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+       
+       r = currentUri.SubString(0, found + 1, baseUri);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+               
+       r = db.Construct(handlerPath, "r+", null);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+       
+       std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select mime, url, allow From " + table + L" Where baseUrl = '" + baseUri + "'"));
+       SysTryReturn(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, L"", GetLastResult(), "[%s] Propagating.", GetErrorMessage(r));
+
+       if(pEnum.get())
+       {
+               while (pEnum->MoveNext() == E_SUCCESS)
+               {                       
+                       String protocol;
+                       String queryUrl;
+                       int allow;
+                       String originScheme;
+
+                       r = pEnum->GetStringAt(0, protocol);
+                       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+               
+                       r = pEnum->GetStringAt(1, queryUrl);
+                       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+                       
+                       r = pEnum->GetIntAt(2, allow);
+                       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+
+                       if (allow == 0)
+                       {
+                               break;
+                       }
+
+                       String protocolScheme(protocol + L":");
+                       
+                       r = originReplace.SubString(0, protocolScheme.GetLength(), originScheme);
+                       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+                                               
+                       if ((originReplace.GetLength() >= protocolScheme.GetLength()) && originScheme.Equals(protocolScheme, false))
+                       {
+                               if (queryUrl.IndexOf(L"%s", 0, foundQuery) == E_SUCCESS)
+                               {
+                                       r = originReplace.Replace(originScheme, "");
+                                       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+                                       
+                                       queryUrl.Replace("%s", originReplace, 0);
+                                       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+
+                                       return queryUrl;
+                               }
+                       }               
+               }
+       }
+       
+       return L"";
+}
+
+
+const Tizen::Base::String 
+_WebImpl::GetRedirectUri(const Tizen::Base::String& originUri, const Tizen::Base::String& currentUri, const Tizen::Base::String& mime)
+{
+       if (originUri == L"" || currentUri == L"" || mime == L"")
+       {
+               return L"";
+       }
+
+       result r = E_SUCCESS;
+       String baseUri;
+       String contentUrl;
+       String originUrlStr = originUri;
+       const String replaceStr = L"%s";
+       _DatabaseImpl db;
+       String handlerPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+       String table(CUSTOM_CONTENT_TABLE_NAME);
+       int allow = 0;
+       int found = 0;
+       
+       r = currentUri.LastIndexOf(L"/", currentUri.GetLength()-1, found);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+               
+       r = currentUri.SubString(0, found + 1, baseUri);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+               
+       r = db.Construct(handlerPath, "r+", null);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+
+       std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select allow, url From " + table + L" Where baseUrl = '" + baseUri + "' AND mime = '" + mime + L"'"));
+       
+       if (pEnum.get())
+       {
+               r = pEnum->MoveNext();
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+               r = pEnum->GetIntAt(0, allow);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+               r = pEnum->GetStringAt(1, contentUrl);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+                       
+               if (allow == 0)
+               {
+                       return L"";
+               }
+               else
+               {
+                       if (contentUrl != L"")
+                       {
+                               r = contentUrl.Replace(replaceStr, originUrlStr, 0);
+                               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, L"", r, "[%s] Propagating.", GetErrorMessage(r));
+
+                               return contentUrl;
+                       }
+               }
+       }
+       
+       return L"";
+}
+
+
 }}} // Tizen::Web::Controls