From a948a1a93aa489139f4dc6dbf4c1aa6f70d624aa Mon Sep 17 00:00:00 2001 From: Hyunseok Yang Date: Tue, 9 Jul 2013 14:00:25 +0900 Subject: [PATCH] change confirm popup Change-Id: I211753b173817883083e15d44a7b5fc550808f52 Signed-off-by: Hyunseok Yang --- src/controls/FWebCtrl_UserConfirmPopup.cpp | 26 ++++- src/controls/FWebCtrl_WebImpl.cpp | 155 +++++++++++++++++++++++++---- src/controls/FWebCtrl_WebImpl.h | 17 +++- 3 files changed, 176 insertions(+), 22 deletions(-) diff --git a/src/controls/FWebCtrl_UserConfirmPopup.cpp b/src/controls/FWebCtrl_UserConfirmPopup.cpp index 287cb39..5dd549a 100755 --- a/src/controls/FWebCtrl_UserConfirmPopup.cpp +++ b/src/controls/FWebCtrl_UserConfirmPopup.cpp @@ -229,7 +229,31 @@ _UserConfirmPopup::OnActionPerformed(const Control& source, int actionId) if (!__sync) { - GetOwner()->SendUserEvent(ID_USER_CONFIRM_POPUP_CLOSE, null); + switch(__userConfirmMode) + { + case USER_CONFIRM_USERMEDIA: + { + GetOwner()->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null); + break; + } + case USER_CONFIRM_GEOLOCATION: + { + GetOwner()->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null); + break; + } + case USER_CONFIRM_NOTIFICATION: + { + GetOwner()->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null); + break; + } + case USER_SCRIPT_ALERT: + { + GetOwner()->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null); + break; + } + default: + SysAssert(false); + } } } diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 1400c76..566a4d3 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -2216,7 +2216,16 @@ _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) + , __pAppCacheConfirmPopup(null) + , __pDbQuotaConfirmPopup(null) + , __pLocalFsQuotaConfirmPopup(null) + , __pIndexedDbQuotaConfirmPopup(null) , __pPromptPopup(null) , __pCertConfirmPopup(null) , __pSelectBox(null) @@ -4633,19 +4642,75 @@ _WebImpl::ShowUserConfirmPopup(_UserConfirmMode userConfirmMode, void* pPolicy, r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, true, msg); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - __pUserConfirmPopup = std::move(pUserConfirmPopup); + pUserConfirmPopup->SetOwner(&GetPublic()); int modalResult = 0; - __pUserConfirmPopup->SetOwner(&GetPublic()); - - r = __pUserConfirmPopup->ShowAndWait(modalResult); - SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - -CATCH: - __pUserConfirmPopup.reset(); + switch(userConfirmMode) + { + case USER_CONTENT_HANDLER: + { + __pContentHandlerConfirmPopup.reset(); - return r; + __pContentHandlerConfirmPopup = std::move(pUserConfirmPopup); + + r = __pContentHandlerConfirmPopup->ShowAndWait(modalResult); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pContentHandlerConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r)); + break; + } + case USER_PROTOCOL_HANDLER: + { + __pProtocolHandlerConfirmPopup.reset(); + + __pProtocolHandlerConfirmPopup = std::move(pUserConfirmPopup); + + r = __pProtocolHandlerConfirmPopup->ShowAndWait(modalResult); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pProtocolHandlerConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r)); + break; + } + case USER_CONFIRM_APP_CACHE: + { + __pAppCacheConfirmPopup.reset(); + + __pAppCacheConfirmPopup = std::move(pUserConfirmPopup); + + r = __pAppCacheConfirmPopup->ShowAndWait(modalResult); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pAppCacheConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r)); + break; + } + case USER_CONFIRM_DB_QUOTA_EXCEDED: + { + __pDbQuotaConfirmPopup.reset(); + + __pDbQuotaConfirmPopup = std::move(pUserConfirmPopup); + + r = __pDbQuotaConfirmPopup->ShowAndWait(modalResult); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pDbQuotaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r)); + break; + } + case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED: + { + __pLocalFsQuotaConfirmPopup.reset(); + + __pLocalFsQuotaConfirmPopup = std::move(pUserConfirmPopup); + + r = __pLocalFsQuotaConfirmPopup->ShowAndWait(modalResult); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pLocalFsQuotaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r)); + break; + } + case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED: + { + __pIndexedDbQuotaConfirmPopup.reset(); + + __pIndexedDbQuotaConfirmPopup = std::move(pUserConfirmPopup); + + r = __pIndexedDbQuotaConfirmPopup->ShowAndWait(modalResult); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pIndexedDbQuotaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r)); + break; + } + } +CATCH: + return r; } @@ -4660,20 +4725,63 @@ _WebImpl::ShowUserConfirmPopupAsync(_UserConfirmMode userConfirmMode, void* pPol r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, false, msg); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - __pUserConfirmPopup = std::move(pUserConfirmPopup); + pUserConfirmPopup->SetOwner(&GetPublic()); - __pUserConfirmPopup->SetOwner(&GetPublic()); + switch(userConfirmMode) + { + case USER_CONFIRM_USERMEDIA: + { + __pUserMediaConfirmPopup.reset(); - r = __pUserConfirmPopup->ShowPopup(); - SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + __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); - __pUserConfirmPopup.release(); + r = __pScriptAlertConfirmPopup->ShowPopup(); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pScriptAlertConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r)); + + __pScriptAlertConfirmPopup.release(); + break; + } + } return E_SUCCESS; CATCH: - __pUserConfirmPopup.reset(); - return r; } @@ -4805,8 +4913,17 @@ _WebImpl::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::ILi case ID_PROMPT_POPUP_CLOSE: __pPromptPopup.reset(); break; - case ID_USER_CONFIRM_POPUP_CLOSE: - __pUserConfirmPopup.reset(); + 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; default: break; diff --git a/src/controls/FWebCtrl_WebImpl.h b/src/controls/FWebCtrl_WebImpl.h index a2bf268..4ee1700 100755 --- a/src/controls/FWebCtrl_WebImpl.h +++ b/src/controls/FWebCtrl_WebImpl.h @@ -133,7 +133,10 @@ enum _WebPopupCloseId { ID_CERTIFICATE_CONFIRM_POPUP_CLOSE, ID_PROMPT_POPUP_CLOSE, - ID_USER_CONFIRM_POPUP_CLOSE + ID_USER_CONFIRM_USERMEDIA_CLOSE, + ID_USER_CONFIRM_GEOLOCATION_CLOSE, + ID_USER_CONFIRM_NOTIFICATION_CLOSE, + ID_USER_SCRIPT_ALERT_CLOSE }; class _WebImpl @@ -477,7 +480,17 @@ private: std::unique_ptr __pAuthChallenge; std::unique_ptr<_AuthConfirmPopup> __pAuthPopup; - std::unique_ptr<_UserConfirmPopup> __pUserConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pUserMediaConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pContentHandlerConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pProtocolHandlerConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pGeolocationConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pNotificationConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pScriptAlertConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pAppCacheConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pDbQuotaConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pLocalFsQuotaConfirmPopup; + std::unique_ptr<_UserConfirmPopup> __pIndexedDbQuotaConfirmPopup; + std::unique_ptr< _PromptPopup > __pPromptPopup; std::unique_ptr<_CertificateConfirmPopup> __pCertConfirmPopup; -- 2.7.4