Revert "change callback functions type with static method"
[framework/osp/web.git] / src / controls / FWebCtrl_WebImpl.cpp
index 1280cb0..c308c2a 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 <FApp_AppManagerImpl.h>
 #include <FBase_StringConverter.h>
 #include <FCnt_DownloadManagerImpl.h>
+#include <FCnt_ContentManagerImpl.h>
 #include <FGrp_CoordinateSystem.h>
+#include <FGrp_Screen.h>
 #include <FIo_DatabaseImpl.h>
 #include <FIo_NormalFile.h>
+#include <FSys_SystemResource.h>
+#include <FSys_VibratorImpl.h>
 #include <FUi_Control.h>
 #include <FUi_CoordinateSystemUtils.h>
 #include <FUi_EcoreEvasMgr.h>
 #include <FUiAnim_EflNode.h>
 #include <FUiAnim_VisualElement.h>
 #include <FUiCtrl_FooterImpl.h>
-#include <FUiCtrl_Form.h>
+#include <FUiCtrl_FormImpl.h>
 #include "FWeb_HistoryItemImpl.h"
 #include "FWebCtrl_AppControlListener.h"
 #include "FWebCtrl_AuthConfirmPopup.h"
 #include "FWebCtrl_AuthenticationChallengeImpl.h"
 #include "FWebCtrl_EflWebkit.h"
+#include "FWebCtrl_FormDataWindow.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"
 #include "FWebCtrl_WebEvent.h"
 #include "FWebCtrl_WebEventArg.h"
 #include "FWebCtrl_WebImpl.h"
+#include "FWebCtrl_WebManager.h"
 #include "FWebCtrl_WebPresenter.h"
 #include "FWebCtrl_WebSettingImpl.h"
 
@@ -114,6 +122,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;
@@ -140,6 +149,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
@@ -333,20 +343,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;
 }
 
@@ -357,26 +362,12 @@ 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;
-       r = messageBox.Construct(L"", msg, MSGBOX_STYLE_OKCANCEL);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       int modalResult = 0;
-       r = messageBox.ShowAndWait(modalResult);
+       r = pImpl->ShowUserConfirmPopup(USER_SCRIPT_CONFIRM, pView, msg);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       if (modalResult == MSGBOX_RESULT_OK)
-       {
-               ewk_view_javascript_confirm_reply(pView, EINA_TRUE);
-       }
-       else
-       {
-               ewk_view_javascript_confirm_reply(pView, EINA_FALSE);
-       }
-
        return EINA_TRUE;
 }
 
@@ -387,32 +378,20 @@ 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;
-
-       r = pPromptPopup.Construct(msg, defVal);
-       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, returnValue = EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       r = pPromptPopup.ShowAndWait(modalResult);
-       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, returnValue = EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       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 = pImpl->ShowPromptPopup(msg, defVal);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-               ewk_view_javascript_prompt_reply(pView, pResult.get());
-               return EINA_TRUE;
-       }
+       return EINA_TRUE;
 
 CATCH:
        ewk_view_javascript_prompt_reply(pView, null);
-       return returnValue;
+
+       return EINA_FALSE;
 }
 
 
@@ -423,6 +402,8 @@ 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");
 
+       _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+
        switch (pImpl->GetSetting().GetCertificateErrorHandlingMode())
        {
        case WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM:
@@ -435,14 +416,47 @@ OnCertificateRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
                result r = E_SUCCESS;
 
-               r = pImpl->ShowCertificateConfirmPopup(CERTIFICATE_POPUP_MODE_USER_CONFIRM, pPolicy);
+               std::unique_ptr<DbEnumerator> pEnum;
+
+               String certificatePath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+               String table(CERTIFICATE_TABLE_NAME);
+               _DatabaseImpl db;
+
+               String pem(ewk_certificate_policy_decision_certificate_pem_get(pPolicy));
+
+               r = db.Construct(certificatePath, "r", null);
                SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-               pImpl->SetCertificateRequested(true);
+               pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select allow From " + table + L" Where pem = '" + pem + L"'"));
+               if (pEnum.get())
+               {
+                       r = pEnum->MoveNext();
+                       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+                       int allow = 0;
+                       r = pEnum->GetIntAt(0, allow);
+                       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+                       SysLog(NID_WEB_CTRL, "The current value of allow is %d", allow);
+
+                       ewk_certificate_policy_decision_allowed_set(pPolicy, static_cast < Eina_Bool >(allow));
+                       pImpl->SetCertificateConfirmed(static_cast < bool >(allow));
+               }
+               else
+               {
+                       r = pImpl->ShowCertificateConfirmPopup(CERTIFICATE_POPUP_MODE_USER_CONFIRM, pPolicy);
+                       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+                       ewk_view_resume(pWebCore->GetWebNativeNode());
+               }
+
+               if (pImpl)
+               {
+                       pImpl->SetCertificateRequested(true);
+               }
                break;
        }
        case WEB_CERTIFICATE_ERROR_HANDLING_MODE_CANCEL:
-CATCH:
                ewk_certificate_policy_decision_allowed_set(pPolicy, EINA_FALSE);
                break;
        case WEB_CERTIFICATE_ERROR_HANDLING_MODE_CONTINUE :
@@ -451,6 +465,15 @@ CATCH:
        default:
                SysAssert(false);
        }
+
+       return;
+
+CATCH:
+       ewk_certificate_policy_decision_allowed_set(pPolicy, EINA_FALSE);
+       pImpl->SetCertificateConfirmed(false);
+       pImpl->SetCertificateRequested(true);
+
+       ewk_view_resume(pWebCore->GetWebNativeNode());
 }
 
 
@@ -492,6 +515,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)
@@ -565,20 +658,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);
 }
 
 
@@ -589,17 +682,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();
+       pImpl->SetWebNotification(pNotificationWindow.release());
+
        ewk_notification_showed(pContext, notificationId);
 }
 
@@ -618,63 +720,151 @@ 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
+OnFullScreenEntered(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+       _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+       SysAssertf(pImpl, "Failed to request");
+
+       SysLog(NID_WEB_CTRL, "Enter.");
+}
+
+
+void
+OnFullScreenExited(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+       _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+       SysAssertf(pImpl, "Failed to request");
+
+       SysLog(NID_WEB_CTRL, "Exit.");
+}
+
+
+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();
 }
 
 
@@ -686,7 +876,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")
        {
@@ -739,6 +929,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);
 
@@ -756,35 +956,23 @@ OnLoadingRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
                result r = E_SUCCESS;
 
-               _WebEventType eventType = WEB_EVENT_REQUEST_UNKNOWN;
-
-               if (uriScheme == L"rtsp")
-               {
-                       eventType = WEB_EVENT_REQUEST_RTSP;
-               }
-               else if (uriScheme == L"mailto")
-               {
-                       eventType = WEB_EVENT_REQUEST_EMAIL;
-               }
-               else if (uriScheme == L"tel")
+               if (uriScheme == L"tel")
                {
-                       eventType = WEB_EVENT_REQUEST_TEL;
+                       String operationId(L"http://tizen.org/appcontrol/operation/dial");
+                       r = _AppControlImpl::FindAndStart(operationId, &url, null, null, null, null);
                }
-               else if (uriScheme == L"sms" || uriScheme == L"smsto" )
+               else if (uriScheme == L"mailto" || uriScheme == L"sms" || uriScheme == L"smsto" || uriScheme == L"mms" || uriScheme == L"mmsto" )
                {
-                       eventType = WEB_EVENT_REQUEST_SMS;
+                       String operationId(L"http://tizen.org/appcontrol/operation/compose");
+                       r = _AppControlImpl::FindAndStart(operationId, &url, null, null, null, null);
                }
-               else if (uriScheme == L"mms" || uriScheme == L"mmsto" )
+               else
                {
-                       eventType = WEB_EVENT_REQUEST_MMS;
+                       String operationId(L"http://tizen.org/appcontrol/operation/view");
+                       String mime(ewk_policy_decision_response_mime_get(pPolicy));
+                       r = _AppControlImpl::FindAndStart(operationId, &url, &mime, null, null, null);
                }
-
-               std::unique_ptr<_WebEventArg> pEventArg(new _WebEventArg(eventType, url));
-               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();
 
                return;
        }
@@ -878,12 +1066,18 @@ OnWebDataReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
        result r = E_SUCCESS;
 
+       _SystemResource* pSysResource = _SystemResource::GetInstance();
+       SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+
        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);
@@ -908,6 +1102,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;
@@ -915,69 +1119,23 @@ OnWebDataReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
                
                else
                {
-                       SysLog(NID_WEB_CTRL, "Lauch native app to handle the mime");
-
                        ewk_policy_decision_ignore(pPolicy);
 
-                       AppControl* pAppControl = null;
-                       _SelectBox selectBox;
-                       int appCount = 0;
-                       int selectedIndex = 0;
-
-                       std::unique_ptr<IList, AllElementsDeleter> pList(_AppManagerImpl::FindAppControlsN(NULL, NULL, &mime, NULL));
-
-                       if (pList.get())
-                       {
-                               appCount = pList->GetCount();
-                       }
-
-                       r = selectBox.Construct(false, L"", appCount+1); //+1 for Downloader
-                       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
-                       selectBox.AddListItem(L"Download", _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
-                       for (int i = 0; i < appCount; i++)
-                       {
-                               pAppControl = dynamic_cast< AppControl* >(pList->GetAt(i));
-                               SysTryReturnVoidResult(NID_WEB_CTRL, pAppControl, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-                               String text = pAppControl->GetAppName();
-                               SysLog(NID_WEB_CTRL, "AppName : %S", text.GetPointer());
-
-                               selectBox.AddListItem(text, _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
-                       }
-                       r = selectBox.ShowAndWait(selectedIndex);
-                       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
-                       if (selectedIndex == 0) //download
-                       {
-                               RequestId reqId = 0;
-                               DownloadRequest request(pUrl);
-
-                               _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
-                               SysTryReturnVoidResult(NID_WEB_CTRL, pManagerImpl, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+                       String operationId(L"http://tizen.org/appcontrol/operation/view");
 
-                               r = pManagerImpl->Start(request, reqId);
-                               SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-                       }
-                       else if (selectedIndex != -1) // -1 for cancel
+                       r = _AppControlImpl::FindAndStart(operationId, &url, &mime, null, null, null);
+                       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS || r == E_OBJ_NOT_FOUND, r, "[%s] Propagating.", GetErrorMessage(r));
+       
+                       if (r == E_OBJ_NOT_FOUND)
                        {
-                               String path("path");
-                               String pathVal(pUrl);
-
-                               HashMap dataList;
-                               r = dataList.Construct();
-                               SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+                               _SelectBox* pSelectBox = new (std::nothrow) _SelectBox;
+                               SysTryReturnVoidResult(NID_WEB_CTRL, pSelectBox, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-                               r = dataList.Add(path, pathVal);
+                               r = pSelectBox->Construct(false, L"Select application", 1, null, url);
                                SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
-                               pAppControl = dynamic_cast< AppControl* >(pList->GetAt(selectedIndex));
-                               SysTryReturnVoidResult(NID_WEB_CTRL, pAppControl, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-                               _AppControlImpl* pAcImpl = _AppControlImpl::GetInstance(*pAppControl);
-                               SysTryReturnVoidResult(NID_WEB_CTRL, pAcImpl, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-                               r = pAcImpl->Start(null, null, &dataList, null);
+                               pSelectBox->AddListItem(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_DOWNLOAD"), _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
+                               r = pSelectBox->ShowPopup();
                                SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
                        }
 
@@ -1051,19 +1209,23 @@ OnLoadingErrorOccurred(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
        SysLog(NID_WEB_CTRL, "The current value of code is %d, description is %s", code, pDescription);
 
-       pImpl->SetLoadingErrorOccurred(true);
        switch (code)
        {
        case EWK_ERROR_CODE_FRAMELOADINTERRUPTEDBYPOLICYCHANGE:
-               //fall through
+               pImpl->SetLoadingErrorOccurred(true);
+               break;
+
        case EWK_ERROR_CODE_PLUGINWILLHANDLELOAD:
+               evas_object_smart_callback_call(pView, "load,finished", NULL);
                break;
 
        case EWK_ERROR_NETWORK_STATUS_CANCELLED:
+               pImpl->SetLoadingErrorOccurred(true);
                evas_object_smart_callback_call(pView, "load,stop", NULL);
                break;
 
        default:
+               pImpl->SetLoadingErrorOccurred(true);
                if (pImpl->GetLoadingListener())
                {
                        result r = E_SUCCESS;
@@ -1119,13 +1281,6 @@ OnLoadingCompleted(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
 
 void
-OnLoadingCommitted(void* pUserData, Evas_Object* pView, void* pEventInfo)
-{
-       evas_object_focus_set(pView, EINA_FALSE);
-}
-
-
-void
 OnFaviconReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
@@ -1152,7 +1307,7 @@ 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);
 }
 
 
@@ -1392,8 +1547,7 @@ void
 OnWebPageBlockSelected(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
-       Ewk_Text_Style* pStyle = reinterpret_cast< Ewk_Text_Style* >(pEventInfo);
-       SysAssertf(pImpl && pStyle, "Failed to request");
+       SysAssertf(pImpl, "Failed to request");
 
        if (pImpl->GetUiEventListener())
        {
@@ -1415,93 +1569,91 @@ OnWebPageBlockSelected(void* pUserData, Evas_Object* pView, void* pEventInfo)
 Eina_Bool
 OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData)
 {
-       Eina_Bool ret = EINA_FALSE;
-       Eina_List* pSelectedFileNames = null;
+       std::unique_ptr<_MediaSelectionListener> pMediaListener(new (std::nothrow) _MediaSelectionListener());
+       SysTryReturn(NID_WEB_CTRL, pMediaListener.get(), EINA_TRUE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+       pMediaListener->Construct(pView);
+
+       HashMap extraData;
+       result r = extraData.Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_TRUE, r, "[%s] Propagating.", GetErrorMessage(r));
+
        String isMultipleSelection(L"single");
+       String mode(L"selectionType");
+       String type(L"type");
+       String fileType = L"*/*";
+       String operationId = L"http://tizen.org/appcontrol/operation/pick";
 
        if (multipleFile)
        {
                isMultipleSelection.Append(L"multiple");
        }
 
-       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));
-
+       if (eina_list_count(pAcceptTypes) == 1)
        {
-               int itemCount = eina_list_count(pAcceptTypes);
-               String fileType = L"all";
+               String item((char*)eina_list_nth(pAcceptTypes, 0));
+               String captureString(pCapture);
 
-               if (itemCount == 1)
+               if (item.StartsWith("image/",0))
                {
-                       String item((char*)eina_list_nth(pAcceptTypes, 0));
-                       if (item.StartsWith("image/",0))
-                       {
-                               fileType = L"image";
-                       }
-                       else if (item.StartsWith("audio/",0))
+                       if (captureString == L"camera")
                        {
-                               fileType = L"audio";
+                               fileType = L"image/jpg";
+                               operationId = L"http://tizen.org/appcontrol/operation/create_content";
+                               String typeKey = L"http://tizen.org/appcontrol/data/camera/allow_switch";
+                               String typeVal = L"false";
+                               extraData.Add(&typeKey, &typeVal);
                        }
-                       else if (item.StartsWith("video/",0))
+                       else
                        {
-                               fileType = L"video";
+                               fileType = L"image/*";
+                               String selectKey = L"http://tizen.org/appcontrol/data/selection_mode";
+                               extraData.Add(&selectKey, &isMultipleSelection);
                        }
                }
-
-               HashMap dataList;
-               result r = dataList.Construct();
-               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
-               String mode(L"selectionType");
-               r = dataList.Add(mode, isMultipleSelection);
-               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
-               String type(L"type");
-               r = dataList.Add(type, fileType);
-               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
-               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));
-
-               while (true)
+               else if (item.StartsWith("audio/",0))
                {
-                       if (pMediaListener->IsSelectionCompleted())
+                       fileType = L"audio/*";
+                       //TO DO: as microphone is not supported yet. suggest to throw an exception
+                       //if (captureString == L"microphone")
+                       //{
+                               //operationId = L"http://tizen.org/appcontrol/operation/create_content";
+                       //}
+                       //else
+                       //{
+                               String selectKey = L"http://tizen.org/appcontrol/data/selection_mode";
+                               extraData.Add(&selectKey, &isMultipleSelection);
+                       //}
+               }
+               else if (item.StartsWith("video/",0))
+               {
+                       if (captureString == L"camcorder")
                        {
-                               const ArrayList* pSelectedFiles = pMediaListener->GetSelectedFiles();
-                               SysTryCatch(NID_WEB_CTRL, pSelectedFiles, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
-
-                               int fileCount = pSelectedFiles->GetCount();
-
-                               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));
-
-                                       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()));
-                               }
-
-                               ret = EINA_TRUE;
-                               break;
+                               fileType = L"video/3gpp";
+                               operationId = L"http://tizen.org/appcontrol/operation/create_content";
+                               String typeKey = L"http://tizen.org/appcontrol/data/camera/allow_switch";
+                               String typeVal = L"false";
+                               extraData.Add(&typeKey, &typeVal);
+                       }
+                       else
+                       {
+                               fileType = L"video/*";
+                               String selectKey = L"http://tizen.org/appcontrol/data/selection_mode";
+                               extraData.Add(&selectKey, &isMultipleSelection);
                        }
-
-                       ecore_main_loop_iterate();
                }
-
-               ewk_view_open_panel_reply(pView, pSelectedFileNames, ret);
-               return ret;
        }
 
+       r = _AppControlImpl::FindAndStart(operationId, null, &fileType, null, &extraData, pMediaListener.get());
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       pMediaListener.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;
 }
 
 
@@ -1535,6 +1687,11 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
        Eina_Rectangle* pEinaRect = reinterpret_cast< Eina_Rectangle* >(pEventInfo);
        SysAssertf(pImpl && pEinaRect, "Failed to request");
 
+       if (pImpl->IsVisible() == false)
+       {
+               evas_object_focus_set(pView, EINA_FALSE);
+       }
+
        if (pImpl->GetSetting().GetInputStyle() == INPUT_STYLE_OVERLAY)
        {
                _ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetInverseTransformer();
@@ -1547,13 +1704,16 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                        return;
                }
 
-               _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-               if (pFormCore->HasFooter() && pFormCore->IsFooterVisible())
+               _FormImpl* pFormImpl = pImpl->GetParentFormImpl(dynamic_cast< _ControlImpl* >(pImpl));
+               if (pFormImpl)
                {
-                       pImpl->SetFooterVisibleState(true);
-                       pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+                       pFormImpl->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
+
+                       if (pFormImpl->HasFooter())
+                       {
+                               pFormImpl->GetCore().SetKeypadShowState(true);
+                               pFormImpl->Draw();
+                       }                       
                }
 
                if (pImpl->GetWebKeypadEventListener())
@@ -1567,7 +1727,6 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                        }
                        else
                        {
-                               pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
                                pImpl->GetWebKeypadEventListener()->OnWebKeypadWillOpen(*dynamic_cast< Web* >(&pImpl->GetPublic()));
                        }
                }
@@ -1601,16 +1760,17 @@ OnWebKeypadClosed(void* pUserData, Evas_Object* pView, void* pEventInfo)
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        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())
+       _FormImpl* pFormImpl = pImpl->GetParentFormImpl(dynamic_cast< _ControlImpl* >(pImpl));
+       if (pFormImpl)
        {
-               pImpl->SetFooterVisibleState(false);
-               pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
-       }
+               pFormImpl->DeflateClientRectHeight(0);
 
-       pFormCore->DeflateClientRectHeight(0);
+               if (pFormImpl->HasFooter())
+               {
+                       pFormImpl->GetCore().SetKeypadShowState(false);
+                       pFormImpl->Draw();
+               }
+       }
 
        if (pImpl->GetWebKeypadEventListener())
        {
@@ -1622,38 +1782,38 @@ OnWebKeypadClosed(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
 
 void
-OnWindowObjectFocusGained(void *pUserData, Evas_Object *pWin, void *pEvent_info)
+OnWindowObjectFocusGained(void* pUserData, Evas_Object* pWin, void* pEvent_info)
 {
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        SysAssertf(pImpl, "Failed to request");
 
-       if (pImpl->IsKeypadOpened() == true)
+       if (pImpl->IsKeypadOpened() == true && pImpl->IsVisible() == true && pImpl->IsFocused() == true)
        {
                _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
                SysAssertf(pWebCore, "Failed to get Web core object");
 
                evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
 
-               pImpl->SetKeypadOpened(false);
+               pImpl->SetKeypadVisibleState(true);
        }
 }
 
 
 void
-OnWebNativeNodeFocusGained(void *pUserData, Evas *pCanvas, Evas_Object* pView, void* pEventInfo)
+OnWebNativeNodeFocusGained(void* pUserData, Evas* pCanvas, Evas_Object* pView, void* pEventInfo)
 {
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        SysAssertf(pImpl, "Failed to request");
 
        if (pImpl->IsKeypadOpened() == true)
        {
-               pImpl->SetKeypadOpened(false);
+               pImpl->SetKeypadOpened(false);  
        }
 } 
 
 
 Eina_Bool
-OnColorPickerProviderRequested(Ewk_View_Smart_Data *pSmartData, int red, int green, int blue, int alpha)
+OnColorPickerProviderRequested(Ewk_View_Smart_DatapSmartData, int red, int green, int blue, int alpha)
 {
        SysAssertf(pSmartData, "invalid smartdata");
        _WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
@@ -1680,7 +1840,7 @@ OnColorPickerProviderRequested(Ewk_View_Smart_Data *pSmartData, int red, int gre
 
 
 Eina_Bool
-OnColorPickerProviderDismissed(Ewk_View_Smart_Data *pSmartData)
+OnColorPickerProviderDismissed(Ewk_View_Smart_DatapSmartData)
 {
        SysAssertf(pSmartData, "invalid smartdata");
 
@@ -1692,7 +1852,7 @@ OnColorPickerProviderDismissed(Ewk_View_Smart_Data *pSmartData)
 
 
 Eina_Bool
-OnDatePickerProviderRequested(Ewk_View_Smart_Data *pSmartData, Ewk_Input_Type inputType, const char* inputValue)
+OnDatePickerProviderRequested(Ewk_View_Smart_DatapSmartData, Ewk_Input_Type inputType, const char* inputValue)
 {
        SysAssertf(pSmartData, "Failed to request");
        _WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
@@ -1722,7 +1882,7 @@ OnDatePickerProviderRequested(Ewk_View_Smart_Data *pSmartData, Ewk_Input_Type in
 
 
 Eina_Bool
-OnSelectBoxRequested(Ewk_View_Smart_Data *pSmartData, Eina_Rectangle rect, Ewk_Text_Direction textDirection, double pageScaleFactor, Eina_List* pItems, int selectedIndex)
+OnSelectBoxRequested(Ewk_View_Smart_DatapSmartData, Eina_Rectangle rect, Ewk_Text_Direction textDirection, double pageScaleFactor, Eina_List* pItems, int selectedIndex)
 {
        SysAssertf(pSmartData, "Failed to request");
 
@@ -1737,7 +1897,22 @@ OnSelectBoxRequested(Ewk_View_Smart_Data *pSmartData, Eina_Rectangle rect, Ewk_T
 
 
 Eina_Bool
-OnSelectBoxClosed(Ewk_View_Smart_Data *pSmartData)
+OnMultiSelectBoxRequested(Ewk_View_Smart_Data* pSmartData, Eina_Rectangle rect, Ewk_Text_Direction text_direction, double page_scale_factor, Eina_List* pItems)
+{
+       SysAssertf(pSmartData, "Failed to request");
+
+       _WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
+       SysAssertf(pWebImpl, "Failed to get Impl");
+
+       result r = pWebImpl->ShowSelectBoxPopup(true, L"", pItems, pSmartData->self, 0);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return EINA_TRUE;
+}
+
+
+Eina_Bool
+OnSelectBoxClosed(Ewk_View_Smart_Data* pSmartData)
 {
        SysAssertf(pSmartData, "invalid smartdata");
 
@@ -1766,6 +1941,72 @@ OnSelectBoxUpdateRequested(Ewk_View_Smart_Data *pSmartData, Eina_Rectangle rect,
 }
 
 
+Eina_Bool
+OnFormDataCandidateShow(Ewk_View_Smart_Data *pSmartData, int x, int y, int w, int h)
+{
+       SysAssertf(pSmartData, "Failed to request");
+
+       _WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
+       SysAssertf(pWebImpl, "Failed to get Impl");
+
+       Rectangle windowRect(x, y, w, h);
+       result r = pWebImpl->ShowFormDataWindow(windowRect, pSmartData->self);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return EINA_TRUE;
+}
+
+
+Eina_Bool
+OnFormDataCandidateHide(Ewk_View_Smart_Data *pSmartData)
+{
+       SysAssertf(pSmartData, "Failed to request");
+
+       _WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
+       SysAssertf(pWebImpl, "Failed to get Impl");
+
+       if (pWebImpl->IsFormDataWindowVisible())
+       {
+               pWebImpl->HideFormDataWindow();
+       }
+
+       return EINA_TRUE;
+}
+
+
+Eina_Bool
+OnFormDataCandidateUpdate(Ewk_View_Smart_Data *pSmartData, Eina_List *pDataList)
+{
+       SysAssertf(pSmartData, "Failed to request");
+
+       _WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
+       SysAssertf(pWebImpl, "Failed to get Impl");
+
+       pWebImpl->SetFormDataList(pDataList);
+
+       return EINA_TRUE;
+}
+
+
+Eina_Bool
+OnFormDataCandidateIsShowing(Ewk_View_Smart_Data *pSmartData)
+{
+       SysAssertf(pSmartData, "Failed to request");
+
+       _WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
+       SysAssertf(pWebImpl, "Failed to get Impl");
+
+       if (pWebImpl->IsFormDataWindowVisible())
+       {
+               return EINA_TRUE;
+       }
+       else
+       {
+               return EINA_FALSE;
+       }
+}
+
+
 void
 OnCookiesPolicyGot(Ewk_Cookie_Accept_Policy policy, Ewk_Web_Error *pError, void *pUserData)
 {
@@ -1806,7 +2047,12 @@ 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));
+       _WebManager* pWebManager = _WebManager::GetInstance();
+       if (pWebManager->IsValidCallback(reinterpret_cast< int >(pImpl), reinterpret_cast< int >(pPresenter)))
+       {
+               pPresenter->EndAsyncProcess(result);
+       }
 }
 
 
@@ -1916,6 +2162,7 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
        , __isRedirectRequested(false)
        , __isCertificateRequested(false)
        , __isCertificateConfirmed(false)
+       , __isFormDataVisible(false)
        , __keypadBounds(0, 0, 0, 0)
        , __pWebCore(null)
        , __pUserLoadingListener(null)
@@ -1931,12 +2178,28 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
        , __pWebEvent(null)
        , __pAuthChallenge(null)
        , __pAuthPopup(null)
-       , __pUserConfirmPopup(null)
+       , __pUserMediaConfirmPopup(null)
+       , __pContentHandlerConfirmPopup(null)
+       , __pProtocolHandlerConfirmPopup(null)
+       , __pGeolocationConfirmPopup(null)
+       , __pNotificationConfirmPopup(null)
+       , __pScriptAlertConfirmPopup(null)
+       , __pScriptConfirmPopup(null)
+       , __pAppCacheConfirmPopup(null)
+       , __pDbQuotaConfirmPopup(null)
+       , __pLocalFsQuotaConfirmPopup(null)
+       , __pIndexedDbQuotaConfirmPopup(null)
+       , __pPromptPopup(null)
        , __pCertConfirmPopup(null)
        , __pSelectBox(null)
        , __pDatePicker(null)
        , __pColorPicker(null)
+       , __pFormDataWindow(null)
+       , __pVibrator(null)
        , __policy(WEB_DECISION_CONTINUE)
+       , __defaultUserAgent(L"")
+       , __pFormDataList(null)
+       , __popupClosed(false)
 {
        __textSearch.__searchAll = false;
        __textSearch.__searchForward = true;
@@ -1950,9 +2213,10 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
 
 _WebImpl::~_WebImpl()
 {
-       RemoveEventListenerCallback();
+       ClearCertificateDb();
 }
 
+
 _WebImpl*
 _WebImpl::CreateWebImplN(Web* pControl, const Rectangle& bounds)
 {
@@ -2026,12 +2290,20 @@ _WebImpl::Construct(void)
        r = __textSearch.__searchQueue.Construct();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       r = __webNotificationList.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));
 
        r = InitWebEvent();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
+       SysTryReturn(NID_WEB_CTRL, pManagerImpl, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       pManagerImpl->SetDownloadListener(this);
+
        __pWebCore = dynamic_cast< _Web* >(&(GetCore()));
        SysTryReturnResult(NID_WEB_CTRL, __pWebCore, E_SYSTEM, "A system error has been occurred. Failed to get web control");
 
@@ -2044,19 +2316,18 @@ _WebImpl::InitializeSetting(void)
 {
        result r = E_SUCCESS;
 
-       r = SetSetting(*__pWebCore->GetSetting());
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       _WebSettingImpl* pWebSettingImpl = _WebSettingImpl::GetInstance(__pWebCore->GetSetting());
+       WebSetting* pWebSetting = __pWebCore->GetSetting();
+       _WebSettingImpl* pWebSettingImpl = _WebSettingImpl::GetInstance(pWebSetting);
 
        SetCookieEnabled(pWebSettingImpl->IsCookieEnabled());
        SetPrivateBrowsingEnabled(pWebSettingImpl->IsPrivateBrowsingEnabled());
-       SetZoomLevel(pWebSettingImpl->GetZoomLevel());
 
-       SetEventListenerCallback();
+       __defaultUserAgent = pWebSettingImpl->GetUserAgent();
+
+       r = SetSetting(*pWebSetting);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-       SysAssertf(pFormCore != null, "Failed to get FormCore");
+       SetEventListenerCallback();
 
        return E_SUCCESS;
 }
@@ -2213,15 +2484,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);
@@ -2329,31 +2599,33 @@ _WebImpl::StopLoading(void) const
 void
 _WebImpl::Reload(void) const
 {
-       ewk_view_reload_bypass_cache(__pWebCore->GetWebNativeNode());
+       ewk_view_reload(__pWebCore->GetWebNativeNode());
 }
 
 
 String*
-_WebImpl::EvaluateJavascriptN(const String& scriptCode) const
+_WebImpl::EvaluateJavascriptN(const String& scriptCode)
 {
-       if (scriptCode.GetLength())
+       Evas_Object* pView = __pWebCore->GetWebNativeNode();
+       if (!pView)
        {
-               std::unique_ptr<char[]> pScript(_StringConverter::CopyToCharArrayN(scriptCode));
-               SysTryReturn(NID_WEB_CTRL, pScript.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               return null;
+       }
+       
+       std::unique_ptr<char[]> pScript(_StringConverter::CopyToCharArrayN(scriptCode));
+       SysTryReturn(NID_WEB_CTRL, pScript.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
-               _WebPresenter presenter;
-               presenter.InitAsyncProcess();
+       std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this));
+       SysTryReturn(NID_WEB_CTRL, pPresenter.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-               ewk_view_script_execute(__pWebCore->GetWebNativeNode(), pScript.get(), OnScriptExecuted, &presenter);
+       ewk_view_script_execute(pView, pScript.get(), OnScriptExecuted, pPresenter.get());
 
-               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);
+       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));
 
-               return pResult;
-       }
+       pPresenter->WaitAsyncProcess(*pResult.get());
 
-       return null;
+       return pResult.release();
 }
 
 
@@ -2378,6 +2650,12 @@ _WebImpl::GetZoomLevel(void) const
 const PageNavigationList*
 _WebImpl::GetBackForwardListN(void) const
 {
+       Evas_Object* pView = __pWebCore->GetWebNativeNode();
+       if (!pView)
+       {
+               return null;
+       }
+
        result r = E_SUCCESS;
 
        _PageNavigationListImpl* pNavigationListImpl = null;
@@ -2392,7 +2670,7 @@ _WebImpl::GetBackForwardListN(void) const
        String url(L"");
        String title(L"");
 
-       Ewk_History* pEwkHistoryList = ewk_view_history_get(__pWebCore->GetWebNativeNode());
+       Ewk_History* pEwkHistoryList = ewk_view_history_get(pView);
        SysTryReturn(NID_WEB_CTRL, pEwkHistoryList, null, E_SYSTEM, "[%s] A system error has been occurred. Failed to get full history.", GetErrorMessage(E_SYSTEM));
 
        Ewk_History_Item* pEwkItem = ewk_history_nth_item_get(pEwkHistoryList, 0);
@@ -2427,7 +2705,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);
 
@@ -2452,6 +2730,12 @@ CATCH:
 bool
 _WebImpl::SearchText(const String& text, bool searchForward)
 {
+       Evas_Object* pView = __pWebCore->GetWebNativeNode();
+       if (!pView)
+       {
+               return false;
+       }
+
        result r = E_SUCCESS;
 
        Ewk_Find_Options condition = static_cast< Ewk_Find_Options >(EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_CASE_INSENSITIVE);
@@ -2461,14 +2745,14 @@ _WebImpl::SearchText(const String& text, bool searchForward)
            condition = static_cast < Ewk_Find_Options >(condition | EWK_FIND_OPTIONS_BACKWARDS);
        }
 
-       _WebPresenter presenter;
-       presenter.InitAsyncProcess();
+       std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this));
+       SysTryReturn(NID_WEB_CTRL, pPresenter.get(), false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       r = SynchronizeSearch(SEARCH_SYNC, __pWebCore->GetWebNativeNode(), condition, text, searchForward, false, &presenter);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       r = SynchronizeSearch(SEARCH_SYNC, pView, condition, text, searchForward, false, pPresenter.get());
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
 
        int result = 0;
-       presenter.WaitAsyncProcess(result);
+       pPresenter->WaitAsyncProcess(result);
 
        return static_cast < bool >(result);
 }
@@ -2477,6 +2761,12 @@ _WebImpl::SearchText(const String& text, bool searchForward)
 result
 _WebImpl::SearchTextAllAsync(const Tizen::Base::String& text, bool caseSensitive)
 {
+       Evas_Object* pView = __pWebCore->GetWebNativeNode();
+       if (!pView)
+       {
+               return E_SUCCESS;
+       }
+
        result r = E_SUCCESS;
 
        Ewk_Find_Options condition = EWK_FIND_OPTIONS_SHOW_HIGHLIGHT;
@@ -2486,7 +2776,7 @@ _WebImpl::SearchTextAllAsync(const Tizen::Base::String& text, bool caseSensitive
            condition = static_cast <Ewk_Find_Options>(condition | EWK_FIND_OPTIONS_CASE_INSENSITIVE);
        }
 
-       r = SynchronizeSearch(SEARCH_ALL_ASYNC, __pWebCore->GetWebNativeNode(), condition, text, true, caseSensitive);
+       r = SynchronizeSearch(SEARCH_ALL_ASYNC, pView, condition, text, true, caseSensitive);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return E_SUCCESS;
@@ -2496,6 +2786,12 @@ _WebImpl::SearchTextAllAsync(const Tizen::Base::String& text, bool caseSensitive
 result
 _WebImpl::SearchNextAsync(bool searchForward)
 {
+       Evas_Object* pView = __pWebCore->GetWebNativeNode();
+       if (!pView)
+       {
+               return E_SUCCESS;
+       }
+
        SysTryReturnResult(NID_WEB_CTRL, __textSearch.__searchAll && __textSearch.__totalCount > -1, E_INVALID_OPERATION, "The SearchTextAllAsync() method is not called or completed.");
        SysTryReturnResult(NID_WEB_CTRL, (searchForward && __textSearch.__currentIndex < __textSearch.__totalCount) || (!searchForward && __textSearch.__currentIndex > 1)
                , E_OBJ_NOT_FOUND,  "The Next instance is not available.");
@@ -2504,7 +2800,7 @@ _WebImpl::SearchNextAsync(bool searchForward)
 
        Ewk_Find_Options condition = EWK_FIND_OPTIONS_SHOW_HIGHLIGHT;
 
-       if (__textSearch.__caseSensitive)
+       if (!__textSearch.__caseSensitive)
        {
                condition = static_cast <Ewk_Find_Options>(condition | EWK_FIND_OPTIONS_CASE_INSENSITIVE);
        }
@@ -2514,7 +2810,7 @@ _WebImpl::SearchNextAsync(bool searchForward)
                condition = static_cast <Ewk_Find_Options>(condition | EWK_FIND_OPTIONS_BACKWARDS);
        }
 
-       r = SynchronizeSearch(SEARCH_NEXT_ASYNC, __pWebCore->GetWebNativeNode(), condition, __textSearch.__text, searchForward);
+       r = SynchronizeSearch(SEARCH_NEXT_ASYNC, pView, condition, __textSearch.__text, searchForward);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return E_SUCCESS;
@@ -2677,10 +2973,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()));
 
@@ -2721,6 +3020,21 @@ _WebImpl::GetSetting(void) const
 const HitElementResult*
 _WebImpl::GetElementByPointN(const Point& point) const
 {
+       return GetElementByPointN(_CoordinateSystemUtils::ConvertToFloat(point));
+}
+
+
+const HitElementResult*
+_WebImpl::GetElementByPointN(const FloatPoint& point) const
+{
+       Evas_Object* pView = __pWebCore->GetWebNativeNode();
+       if (!pView)
+       {
+               return null;
+       }
+
+       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;
@@ -2729,9 +3043,9 @@ _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);
+       Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(pView, 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));
 
        Eina_Hash* pAttrHash = ewk_hit_test_attribute_hash_get(pEwkHitTest);
@@ -2740,7 +3054,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));
@@ -2823,18 +3137,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
 {
@@ -2900,7 +3202,6 @@ void
 _WebImpl::ClearCache(void)
 {
        Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
-       SysAssertf(pContext, "Failed to get webkit instance.");
 
        ewk_context_cache_clear(pContext);
 }
@@ -2911,7 +3212,6 @@ _WebImpl::ClearCookie(void)
 {
        Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
        Ewk_Cookie_Manager* pCookieManager =  ewk_context_cookie_manager_get(pContext);
-       SysAssertf(pCookieManager, "Failed to get webkit instance.");
 
        ewk_cookie_manager_cookies_clear(pCookieManager);
 }
@@ -2921,7 +3221,6 @@ void
 _WebImpl::ClearFormData(void)
 {
        Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
-       SysAssertf(pContext, "Failed to get webkit instance.");
 
        ewk_context_form_candidate_data_clear(pContext);
 }
@@ -2931,7 +3230,6 @@ void
 _WebImpl::ClearLoginFormData(void)
 {
        Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
-       SysAssertf(pContext, "Failed to get webkit instance.");
 
        ewk_context_form_password_data_clear(pContext);
 }
@@ -2949,13 +3247,13 @@ _WebImpl::IsCookieEnabled(void) const
        Ewk_Cookie_Manager* pCookieManager =  ewk_context_cookie_manager_get(pContext);
        SysAssertf(pCookieManager, "Failed to get webkit instance.");
 
-       _WebPresenter presenter;
-       presenter.InitAsyncProcess();
+       std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this));
+       SysTryReturn(NID_WEB_CTRL, pPresenter.get(), false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       ewk_cookie_manager_async_accept_policy_get(pCookieManager, OnCookiesPolicyGot, &presenter);
+       ewk_cookie_manager_async_accept_policy_get(pCookieManager, OnCookiesPolicyGot, pPresenter.get());
 
        bool result = false;
-       presenter.WaitAsyncProcess(result);
+       pPresenter->WaitAsyncProcess(result);
 
        return result;
 }
@@ -2977,7 +3275,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
        {
@@ -3235,6 +3533,7 @@ _WebImpl::SetEventListenerCallback(void) const
                SysAssertf(pSmart, "Failed to request");
 
                pSmart->popup_menu_show = OnSelectBoxRequested;
+               pSmart->multiple_popup_menu_show = OnMultiSelectBoxRequested;
                pSmart->popup_menu_hide = OnSelectBoxClosed;
                pSmart->popup_menu_update = OnSelectBoxUpdateRequested;
 
@@ -3242,6 +3541,11 @@ _WebImpl::SetEventListenerCallback(void) const
                pSmart->input_picker_color_request = OnColorPickerProviderRequested;
                pSmart->input_picker_color_dismiss = OnColorPickerProviderDismissed;
 
+               pSmart->formdata_candidate_show = OnFormDataCandidateShow;
+               pSmart->formdata_candidate_hide = OnFormDataCandidateHide;
+               pSmart->formdata_candidate_update_data = OnFormDataCandidateUpdate;
+               pSmart->formdata_candidate_is_showing = OnFormDataCandidateIsShowing;
+
                evas_object_data_set(pWebNativeNode, WEB_CTRL, this);
 
                // add loading event callbacks for ILoadingListener
@@ -3256,7 +3560,6 @@ _WebImpl::SetEventListenerCallback(void) const
                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);
 
@@ -3297,12 +3600,21 @@ _WebImpl::SetEventListenerCallback(void) const
                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, "text,style,state", OnWebPageBlockSelected, this);
+               evas_object_smart_callback_add(pWebNativeNode, "text,selected", OnWebPageBlockSelected, this);
+
+               evas_object_smart_callback_add(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered, this);
+               evas_object_smart_callback_add(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited, 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_view_open_panel_callback_set(pWebNativeNode, OnSelectUploadFile, 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);
        }
@@ -3335,7 +3647,7 @@ _WebImpl::RemoveEventListenerCallback(void) const
 
                evas_object_smart_callback_del(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest);
 
-               evas_object_smart_callback_del(pWinObject, "focus,in", OnWindowObjectFocusGained);
+               evas_object_smart_callback_del_full(pWinObject, "focus,in", OnWindowObjectFocusGained, this);
 
                evas_object_smart_callback_del(pWebNativeNode, "inputmethod,changed", OnWebKeypadStateChanged);
                evas_object_smart_callback_del(pWebNativeNode, "editorclient,ime,opened", OnWebKeypadOpened);
@@ -3372,47 +3684,106 @@ _WebImpl::RemoveEventListenerCallback(void) const
                evas_object_smart_callback_del(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered);
                evas_object_smart_callback_del(pWebNativeNode, "icon,received", OnFaviconReceived);
 
-               evas_object_smart_callback_del(pWebNativeNode, "text,style,state", OnWebPageBlockSelected);
+               evas_object_smart_callback_del(pWebNativeNode, "text,selected", OnWebPageBlockSelected);
+
+               evas_object_smart_callback_del(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered);
+               evas_object_smart_callback_del(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited);
 
                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);
+
+               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);
 
                evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained);
        }
 }
 
 
-result
-_WebImpl::SetBlockSelectionPosition(const Point& startPoint)
+void
+_WebImpl::ClearCertificateDb(void)
 {
-       Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
+       result r = E_SUCCESS;
 
-       Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
-       SysAssertf(pSmartData, "Failed to request");
+       String certificatePath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+       String table(CERTIFICATE_TABLE_NAME);
+       _DatabaseImpl db;
+
+       r = db.Construct(certificatePath, "r+", null);
+       SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       Point absPoint(__pWebCore->GetAbsoluteCoordinate(startPoint));
+       db.BeginTransaction();
 
-       pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
-       pSmartData->api->text_selection_up(pSmartData, absPoint.x, absPoint.y);
+       r = db.ExecuteSql(L"Delete From " + table, true);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       ewk_view_command_execute(pWebNativeNode, "SelectWord", 0);
+       db.CommitTransaction();
 
-       SysTryReturnResult(NID_WEB_CTRL, GetTextFromBlock().GetLength() > 0, E_INVALID_ARG, "Failed to set text selection up.");
+       return;
 
-       return E_SUCCESS;
+CATCH:
+       db.RollbackTransaction();
+}
+
+
+result
+_WebImpl::SetBlockSelectionPosition(const Point& startPoint)
+{
+       return SetBlockSelectionPosition(_CoordinateSystemUtils::ConvertToFloat(startPoint));
 }
 
 
 result
 _WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
 {
-       return SetBlockSelectionPosition(_CoordinateSystemUtils::ConvertToInteger(startPoint));
+       Evas_Object* pView = __pWebCore->GetWebNativeNode();
+       Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pView);
+       if (pSmartData && pSmartData->api)
+       {
+               Point absPoint( _CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(startPoint)));
+
+               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);
+
+                       Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(pView, absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL);
+                       SysTryReturnResult(NID_WEB_CTRL, pEwkHitTest, E_SYSTEM, "Failed to get hit test.");
+
+                       String tagName(ewk_hit_test_tag_name_get(pEwkHitTest));
+
+                       if (tagName.Equals(L"INPUT", false) || tagName.Equals(L"TEXTAREA", false))
+                       {
+                               ewk_view_command_execute(pView, "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(pView, "SelectWord", 0);
+                               }
+                       }
+               }
+       }
+
+       SysTryReturnResult(NID_WEB_CTRL, GetTextFromBlock().GetLength() > 0, E_INVALID_ARG, "Failed to set text selection up.");
+
+       evas_object_smart_callback_call(pView, "text,selected", NULL);
+
+       return E_SUCCESS;
 }
 
 
 void
 _WebImpl::ReleaseBlock(void)
 {
-       ewk_view_command_execute(__pWebCore->GetWebNativeNode(), "Unselect", 0);
+       ewk_view_text_selection_range_clear(__pWebCore->GetWebNativeNode());
 }
 
 
@@ -3435,6 +3806,9 @@ _WebImpl::GetBlockRange(FloatPoint& startPoint, FloatPoint& endPoint) const
        Eina_Rectangle leftHandle;
        Eina_Rectangle rightHandle;
 
+       EINA_RECTANGLE_SET(&leftHandle, 0, 0, 0, 0);
+       EINA_RECTANGLE_SET(&rightHandle, 0, 0, 0, 0);
+
        ewk_view_text_selection_range_get(__pWebCore->GetWebNativeNode(), &leftHandle, &rightHandle);
 
        startPoint.x = _CoordinateSystemUtils::ConvertToFloat(leftHandle.x);
@@ -3456,18 +3830,9 @@ _WebImpl::GetFaviconN(void) const
        result r = E_SUCCESS;
 
        Evas_Object* pView = __pWebCore->GetWebNativeNode();
-
-       Evas* pEvas = evas_object_evas_get(pView);
        Ewk_Context* pContext = ewk_view_context_get(pView);
-       SysAssertf(pEvas && pContext, "Failed to request");
-
        const char* pUrl = ewk_view_url_get(pView);
-
-       Tizen::Graphics::BufferInfo bufferInfo;
-       Tizen::Base::ByteBuffer byteBuffer;
-
-       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* pEvas = evas_object_evas_get(pView);
 
        Evas_Object* pFavicon = ewk_context_icon_database_icon_object_add(pContext, pUrl, pEvas);
        if (!pFavicon)
@@ -3475,18 +3840,24 @@ _WebImpl::GetFaviconN(void) const
                return null;
        }
 
+       Tizen::Graphics::BufferInfo 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);
-
+       Tizen::Base::ByteBuffer byteBuffer;
+       
        r = byteBuffer.Construct((byte*)bufferInfo.pPixels, 0, dimension.height * dimension.width * 32, dimension.height * dimension.width * 32 );
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = pBitmapImage->Construct(byteBuffer, dimension, BITMAP_PIXEL_FORMAT_ARGB8888);
+       std::unique_ptr<Bitmap> pImage(new (std::nothrow) Bitmap());
+       SysTryReturn(NID_WEB_CTRL, pImage.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+       r = pImage->Construct(byteBuffer, dimension, BITMAP_PIXEL_FORMAT_ARGB8888);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       return pBitmapImage.release();
+       return pImage.release();
 
 }
 
@@ -3530,6 +3901,36 @@ _WebImpl::GetPageSize(void) const
 }
 
 
+result
+_WebImpl::AddHttpHeaderField(const String& name, const String& value)
+{
+       SysTryReturnResult(NID_WEB_CTRL, name.GetLength() > 0, E_INVALID_ARG, "Invalid argument(s) is used. name key is missing.");
+
+       std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(name));
+       SysTryReturn(NID_WEB_CTRL, pName.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       std::unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(value));
+
+       ewk_view_custom_header_add(__pWebCore->GetWebNativeNode(), pName.get(), pValue.get());
+
+       return E_SUCCESS;
+}
+
+
+result
+_WebImpl::RemoveHttpHeaderField(const String& name)
+{
+       SysTryReturnResult(NID_WEB_CTRL, name.GetLength() > 0, E_INVALID_ARG, "Invalid argument(s) is used. name key is missing.");
+
+       std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(name));
+       SysTryReturn(NID_WEB_CTRL, pName.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       ewk_view_custom_header_remove(__pWebCore->GetWebNativeNode(), pName.get());
+
+       return E_SUCCESS;
+}
+
+
 void
 _WebImpl::SetLoadingErrorOccurred(bool arg)
 {
@@ -3586,79 +3987,17 @@ _WebImpl::IsCertificateRequested(void) const
 }
 
 
-bool
-_WebImpl::IsCertificateConfirmed(void) const
+void
+_WebImpl::SetCertificateConfirmed(bool arg)
 {
-       return __isCertificateConfirmed;
+       __isCertificateConfirmed = arg;
 }
 
 
-result
-_WebImpl::LaunchAppControl(const IEventArg& arg)
+bool
+_WebImpl::IsCertificateConfirmed(void) const
 {
-       result r = E_SUCCESS;
-
-       IEventArg* pArg = const_cast< IEventArg* >(&arg);
-       _WebEventArg* pWebEventArg = dynamic_cast< _WebEventArg* >(pArg);
-       SysTryReturnResult(NID_WEB_CTRL, pWebEventArg, E_INVALID_ARG, "Type casting failed. argument must be IEventArg type.");
-
-       String operationId(L"");
-       String uriPattern(pWebEventArg->GetEventMessage());
-       SysLog(NID_WEB_CTRL, "The current value of web event type is %d", pWebEventArg->GetEventType());
-
-       switch (pWebEventArg->GetEventType())
-       {
-       case WEB_EVENT_REQUEST_RTSP:
-       {
-               String ext;
-               String mimeType;
-               int uriLength = uriPattern.GetLength();
-               int index;
-
-               operationId = L"http://tizen.org/appcontrol/operation/view";
-
-               r = uriPattern.LastIndexOf(L".", uriLength - 1, index);
-               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-               r = uriPattern.SubString(index + 1, ext);
-               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-               r = _AppControlManager::GetMimeFromExt(ext, mimeType);
-               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-               r = _AppControlImpl::FindAndStart(operationId, &uriPattern, &mimeType, null, null, null);
-               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-               return r;
-       }
-       case WEB_EVENT_REQUEST_TEL:
-       {
-               operationId = L"http://tizen.org/appcontrol/operation/dial";
-               break;
-       }
-       case WEB_EVENT_REQUEST_EMAIL:
-       //fall through
-       case WEB_EVENT_REQUEST_SMS:
-       //fall through
-       case WEB_EVENT_REQUEST_MMS:
-       {
-               operationId = L"http://tizen.org/appcontrol/operation/compose";
-               break;
-       }
-       case WEB_EVENT_REQUEST_UNKNOWN:
-       {
-               operationId = L"http://tizen.org/appcontrol/operation/view";
-               break;
-       }
-       default:
-               SysAssert(false);
-               break;
-       }
-
-       r = _AppControlImpl::FindAndStart(operationId, &uriPattern, null, null, null, null);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       return r;
+       return __isCertificateConfirmed;
 }
 
 
@@ -3937,8 +4276,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.");
 
@@ -4002,8 +4339,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.");
 
@@ -4102,6 +4437,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;
@@ -4151,11 +4517,15 @@ _WebImpl::ShowAuthenticationPopup(const String& host, const String& realm, Authe
        __pAuthPopup = std::move(pAuthPopup);
 
        int modalResult = 0;
+
        r = __pAuthPopup->ShowAndWait(modalResult);
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
 CATCH:
-       __pAuthPopup.reset();
+       if (__pAuthPopup)
+       {
+               __pAuthPopup.reset();
+       }
 
        return r;
 }
@@ -4169,91 +4539,275 @@ _WebImpl::ShowCertificateConfirmPopup(_CertificatePopupMode userConfirmMode, Ewk
        std::unique_ptr<_CertificateConfirmPopup> pCertConfirmPopup(new (std::nothrow) _CertificateConfirmPopup());
        SysTryReturnResult(NID_WEB_CTRL, pCertConfirmPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
-       r = pCertConfirmPopup->Construct(userConfirmMode, pPolicy);
+       r = pCertConfirmPopup->Construct(userConfirmMode, pPolicy, this);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pCertConfirmPopup = std::move(pCertConfirmPopup);
 
        int modalResult = 0;
+
        r = __pCertConfirmPopup->ShowAndWait(modalResult);
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       if (userConfirmMode == CERTIFICATE_POPUP_MODE_USER_CONFIRM)
+       if (__pCertConfirmPopup.get() && userConfirmMode == CERTIFICATE_POPUP_MODE_USER_CONFIRM)
        {
                __isCertificateConfirmed = __pCertConfirmPopup->GetConfirmResult();
        }
 
 CATCH:
-       __pCertConfirmPopup.reset();
+       if (__pCertConfirmPopup.get())
+       {
+               __pCertConfirmPopup.reset();
+       }
 
        return r;
 }
 
 
 result
-_WebImpl::ShowUserConfirmPopupAsync(_UserConfirmMode userConfirmMode, void* pPolicy)
+_WebImpl::ShowPromptPopup(String msg, String defVal)
 {
        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.");
+       std::unique_ptr< _PromptPopup > pPromptPopup(new (std::nothrow) _PromptPopup());
+       SysTryReturnResult(NID_WEB_CTRL, pPromptPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
-       r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy);
+       r = pPromptPopup->Construct(msg, defVal, __pWebCore->GetWebNativeNode(), this);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       __pUserConfirmPopup = std::move(pUserConfirmPopup);
+       __pPromptPopup = std::move(pPromptPopup);
 
-       r = __pUserConfirmPopup->ShowPopup();
+       r = __pPromptPopup->ShowPopup();
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       __pUserConfirmPopup.release();
-
        return E_SUCCESS;
 
 CATCH:
-       __pUserConfirmPopup.reset();
+       __pPromptPopup.reset();
 
        return r;
+
 }
 
 
-_Form*
-_WebImpl::GetParentFormCore(_Control* pControlCore)
+result
+_WebImpl::ShowUserConfirmPopup(_UserConfirmMode userConfirmMode, void* pPolicy, String msg)
 {
-       String parentName;
-       _Form* pFormCore = null;
+       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, this, true, msg);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       _Control* pParentControlCore = dynamic_cast< _Control* >(pControlCore->GetParent());
+       int modalResult = 0;
 
-       if (pParentControlCore == null)
+       switch(userConfirmMode)
        {
-               _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()));
-               }
+       case USER_CONTENT_HANDLER:
+       {
+               __pContentHandlerConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pContentHandlerConfirmPopup->ShowAndWait(modalResult);
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pContentHandlerConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pContentHandlerConfirmPopup.reset();
+
+               ewk_view_resume(__pWebCore->GetWebNativeNode());
+
+               break;
        }
-       else
+       case USER_PROTOCOL_HANDLER:
        {
-               pFormCore = dynamic_cast< _Form* >(pParentControlCore);
+               __pProtocolHandlerConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pProtocolHandlerConfirmPopup->ShowAndWait(modalResult);
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pProtocolHandlerConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pProtocolHandlerConfirmPopup.reset();
+
+               ewk_view_resume(__pWebCore->GetWebNativeNode());
+
+               break;
        }
+       case USER_CONFIRM_APP_CACHE:
+       {
+               __pAppCacheConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pAppCacheConfirmPopup->ShowAndWait(modalResult);
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pAppCacheConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pAppCacheConfirmPopup.reset();
+
+               ewk_view_resume(__pWebCore->GetWebNativeNode());
 
-       if (pFormCore != null)
+               break;
+       }
+       case USER_CONFIRM_DB_QUOTA_EXCEDED:
        {
-               return pFormCore;
+               __pDbQuotaConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pDbQuotaConfirmPopup->ShowAndWait(modalResult);
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pDbQuotaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pDbQuotaConfirmPopup.reset();
+
+               ewk_view_resume(__pWebCore->GetWebNativeNode());
+
+               break;
+       }
+       case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED:
+       {
+               __pLocalFsQuotaConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pLocalFsQuotaConfirmPopup->ShowAndWait(modalResult);
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pLocalFsQuotaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pLocalFsQuotaConfirmPopup.reset();
+
+               ewk_view_resume(__pWebCore->GetWebNativeNode());
+
+               break;
        }
+       case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED:
+       {
+               __pIndexedDbQuotaConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pIndexedDbQuotaConfirmPopup->ShowAndWait(modalResult);
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pIndexedDbQuotaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pIndexedDbQuotaConfirmPopup.reset();
 
-       return GetParentFormCore(pParentControlCore);
+               ewk_view_resume(__pWebCore->GetWebNativeNode());
+
+               break;
+       }
+       case USER_SCRIPT_CONFIRM:
+       {
+               __pScriptConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pScriptConfirmPopup->ShowAndWait(modalResult);
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pScriptConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pScriptConfirmPopup.reset();
+
+               ewk_view_resume(__pWebCore->GetWebNativeNode());
+
+               break;
+       }
+       default:
+               break;
+       }
+CATCH:
+               return r;
+}
+
+
+result
+_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, this, false, msg);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       switch(userConfirmMode)
+       {
+       case USER_CONFIRM_USERMEDIA:
+    {
+        __pUserMediaConfirmPopup.reset();
+
+               __pUserMediaConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pUserMediaConfirmPopup->ShowPopup();
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pUserMediaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pUserMediaConfirmPopup.release();
+               break;
+       }
+       case USER_CONFIRM_GEOLOCATION:
+       {
+               __pGeolocationConfirmPopup.reset();
+
+               __pGeolocationConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pGeolocationConfirmPopup->ShowPopup();
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pGeolocationConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pGeolocationConfirmPopup.release();
+               break;
+       }
+       case USER_CONFIRM_NOTIFICATION:
+       {
+               __pNotificationConfirmPopup.reset();
+
+               __pNotificationConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pNotificationConfirmPopup->ShowPopup();
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pNotificationConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pNotificationConfirmPopup.release();
+               break;
+       }
+       case USER_SCRIPT_ALERT:
+       {
+               __pScriptAlertConfirmPopup.reset();
+
+               __pScriptAlertConfirmPopup = std::move(pUserConfirmPopup);
+
+               r = __pScriptAlertConfirmPopup->ShowPopup();
+               SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pScriptAlertConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pScriptAlertConfirmPopup.release();
+               break;
+       }
+       default:
+               break;
+       }
+
+       return E_SUCCESS;
+
+CATCH:
+       return r;
+}
+
+
+_FormImpl*
+_WebImpl::GetParentFormImpl(_ControlImpl* pControlImpl)
+{
+       String parentName;
+       _FormImpl* pFormImpl = null;
+
+       _ControlImpl* pParentControlImpl = dynamic_cast< _ControlImpl* >(pControlImpl->GetParent());
+       if (!pParentControlImpl)
+       {
+               return null;
+       }
+
+       pFormImpl = dynamic_cast< _FormImpl* >(pParentControlImpl);
+       if (pFormImpl)
+       {
+               return pFormImpl;
+       }
+
+       return GetParentFormImpl(pParentControlImpl);
 }
 
 
 bool 
 _WebImpl::OnFocusGained(const _ControlImpl& source)
 {
-       return true;
+       Ewk_Settings* pSettings = ewk_view_settings_get(__pWebCore->GetWebNativeNode());
+       SysAssertf(pSettings, "Failed to get webkit instance.");
+       ewk_settings_clear_text_selection_automatically_set(pSettings, true);
+
+       evas_object_focus_set(__pWebCore->GetWebNativeNode(), EINA_TRUE);
+
+       return false;
 }
 
 
@@ -4263,11 +4817,17 @@ _WebImpl::OnFocusLost(const _ControlImpl& source)
        if(IsKeypadVisible() == true)
        {
                SetKeypadOpened(true);
+
+               SetKeypadVisibleState(false);
        }
 
+       Ewk_Settings* pSettings = ewk_view_settings_get(__pWebCore->GetWebNativeNode());
+       SysAssertf(pSettings, "Failed to get webkit instance.");
+       ewk_settings_clear_text_selection_automatically_set(pSettings, false);
+
        evas_object_focus_set(__pWebCore->GetWebNativeNode(), EINA_FALSE);
 
-       return true;
+       return false;
 }
 
 
@@ -4284,63 +4844,152 @@ _WebImpl::HasValidNativeNode(void) const
 
 
 result
-_WebImpl::OnAttachedToMainTree(void)
+_WebImpl::OnPreAttachedToMainTree(void)
 {
        result r = E_SUCCESS;
 
+       if (IsVisible() == true)
+       {
+               _WebManager* pWebManager = _WebManager::GetInstance();
+               pWebManager->SetActiveWeb(this);
+       }
+
        r = __pWebCore->InitializeWebNativeNode();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       _ControlManager* pControlManager = _ControlManager::GetInstance();
+       SysTryReturnResult(NID_WEB_CTRL, pControlManager, E_SYSTEM, "Failed to get the ControlManager instance.");
+       OnChangeLayout(pControlManager->GetScreenRotation());
+
        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));
 
+       _WebManager* pWebManager = _WebManager::GetInstance();
+       pWebManager->AddWeb(reinterpret_cast< int >(this));
+
+       return E_SUCCESS;
+}
+
+
+result
+_WebImpl::OnDetachingFromMainTree(void)
+{
+       _WebManager* pWebManager = _WebManager::GetInstance();
+       pWebManager->RemoveWeb(reinterpret_cast< int >(this));
+       pWebManager->RemoveActiveWeb(this);     
+
+       _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
+       pManagerImpl->SetDownloadListener(null);
+
+       RemoveEventListenerCallback();
+
        return E_SUCCESS;
 }
 
 
 void
-_WebImpl::OnChangeLayout(_ControlOrientation orientation)
+_WebImpl::OnChangeLayout(_ControlRotation rotation)
 {
-       _ContainerImpl::OnChangeLayout(orientation);
+       int degree = 0;
 
-       if (IsKeypadVisible() == true)
+       switch (rotation)
        {
-               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);
+               case _CONTROL_ROTATION_0:
+                       degree =  0;
+                       break;
+               case _CONTROL_ROTATION_90:
+                       degree =  90;
+                       break;
+               case _CONTROL_ROTATION_180:
+                       degree =  180;
+                       break;
+               case _CONTROL_ROTATION_270:
+                       degree =  -90;
+                       break;
+               default:
+                       SysAssert(false);
+       }
+       ewk_view_orientation_send(__pWebCore->GetWebNativeNode(), degree);
+}
 
-               _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
 
-               pFormCore->DeflateClientRectHeight(h);
-       }
+void
+_WebImpl::OnChangeLayout(_ControlOrientation orientation)
+{
+       _ContainerImpl::OnChangeLayout(orientation);
 
        if (__pColorPicker.get())
        {
                __pColorPicker->ChangeLayout(orientation);
        }
+
+       HideFormDataWindow();
+
+       std::unique_ptr< IEnumerator > pEnum(__webNotificationList.GetEnumeratorN());
+       _WebNotification* pWebNotification = null;
+
+       while (pEnum->MoveNext() == E_SUCCESS)
+       {
+               pWebNotification = static_cast< _WebNotification* >(pEnum->GetCurrent());
+               pWebNotification->OnChangeLayout();
+       }
 }
 
 
 void
 _WebImpl::OnAncestorVisibleStateChanged(const _Control& control)
 {
+       _WebManager* pWebManager = _WebManager::GetInstance();
        if (IsVisible() == true)
        {
+               pWebManager->SetActiveWeb(this);
                ewk_view_page_visibility_state_set(__pWebCore->GetWebNativeNode(), EWK_PAGE_VISIBILITY_STATE_VISIBLE, false);
        }
        else
        {
+               pWebManager->RemoveActiveWeb(this);
                ewk_view_page_visibility_state_set(__pWebCore->GetWebNativeNode(), EWK_PAGE_VISIBILITY_STATE_HIDDEN, false);
        }
 }
 
 
+void
+_WebImpl::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
+{
+       _ContainerImpl::OnUserEventReceivedN(requestId, pArgs);
+
+       switch (requestId)
+       {
+       case ID_CERTIFICATE_CONFIRM_POPUP_CLOSE:
+               __pCertConfirmPopup.reset();
+               break;
+       case ID_PROMPT_POPUP_CLOSE:
+               __pPromptPopup.reset();
+               break;
+       case ID_USER_CONFIRM_USERMEDIA_CLOSE:
+               __pUserMediaConfirmPopup.reset();
+               break;
+       case ID_USER_CONFIRM_GEOLOCATION_CLOSE:
+               __pGeolocationConfirmPopup.reset();
+               break;
+       case ID_USER_CONFIRM_NOTIFICATION_CLOSE:
+               __pNotificationConfirmPopup.reset();
+               break;
+       case ID_USER_SCRIPT_ALERT_CLOSE:
+               __pScriptAlertConfirmPopup.reset();
+               break;
+       case ID_USER_SCRIPT_CONFIRM_CLOSE:
+               __pScriptConfirmPopup.reset();
+               break;
+       default:
+               break;
+       }
+}
+
+
 _WebDataHandler*
 _WebImpl::GetDownloadHandler(void) const
 {
@@ -4367,7 +5016,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);
@@ -4375,12 +5024,16 @@ _WebImpl::ShowColorPicker(int red, int green, int blue, int alpha, Color& color)
        r = __pColorPicker->ShowPopup();
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       color = __pColorPicker->GetColor();
-
-       return E_SUCCESS;
+       if (__pColorPicker)
+       {
+               color = __pColorPicker->GetColor();
+       }
 
 CATCH:
-       __pColorPicker.reset();
+       if (__pColorPicker)
+       {
+               __pColorPicker.reset();
+       }
 
        return r;
 }
@@ -4394,7 +5047,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);
@@ -4402,10 +5055,16 @@ _WebImpl::ShowDatePicker(Ewk_Input_Type inputType, const char* inputValue, Strin
        r = __pDatePicker->ShowPopup();
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       dateStr = __pDatePicker->GetDate();
+       if (__pDatePicker)
+       {
+               dateStr = __pDatePicker->GetDate();
+       }
 
 CATCH:
-       __pDatePicker.reset();
+       if (__pDatePicker)
+       {
+               __pDatePicker.reset();
+       }
 
        return r;
 }
@@ -4425,4 +5084,319 @@ _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"";
+}
+
+
+void
+_WebImpl::SetFormDataList(Eina_List* pFormDataList)
+{
+       __pFormDataList = pFormDataList;
+}
+
+
+bool
+_WebImpl::IsFormDataWindowVisible(void) const
+{
+       return __isFormDataVisible;
+}
+
+
+result
+_WebImpl::ShowFormDataWindow(const Rectangle& windowRect, Evas_Object* pWebView)
+{
+       Rectangle rect(_CoordinateSystemUtils::InverseTransform(Rectangle(windowRect.x, windowRect.y + windowRect.height, windowRect.width, windowRect.height)));
+
+       if (__isFormDataVisible)
+       {
+               result r = __pFormDataWindow->UpdateList(__pFormDataList, rect);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       else
+       {
+               __pFormDataWindow.reset();
+
+               std::unique_ptr<_FormDataWindow> pFormDataWindow( new (std::nothrow) _FormDataWindow());
+               SysTryReturnResult(NID_WEB_CTRL, pFormDataWindow.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+               result r = pFormDataWindow->Construct(rect, this, pWebView);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+               r = pFormDataWindow->UpdateList(__pFormDataList, rect);
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+               r = pFormDataWindow->LaunchFormDataWindow();
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+               __pFormDataWindow = std::move(pFormDataWindow);
+               __isFormDataVisible = true;
+       }
+
+       return E_SUCCESS;
+}
+
+
+void
+_WebImpl::HideFormDataWindow(bool delWindow)
+{
+       if (delWindow)
+       {
+               __pFormDataWindow.reset();
+       }
+
+       __isFormDataVisible = false;
+}
+
+
+void
+_WebImpl::ClearWebNotification(_WebNotification* pWebNotification)
+{
+       __webNotificationList.Remove(*pWebNotification);
+}
+
+
+void
+_WebImpl::SetWebNotification(_WebNotification* pWebNotification)
+{
+       __webNotificationList.Add(pWebNotification);
+}
+
+
+void
+_WebImpl::OnDownloadCompleted(RequestId reqId, const String &path)
+{
+       _ContentManagerImpl::ScanFile(path);
+}
+
+
 }}} // Tizen::Web::Controls