change confirm popup
authorHyunseok Yang <hs0219.yang@samsung.com>
Tue, 9 Jul 2013 05:00:25 +0000 (14:00 +0900)
committerHyunseok Yang <hs0219.yang@samsung.com>
Tue, 9 Jul 2013 06:26:49 +0000 (15:26 +0900)
Change-Id: I211753b173817883083e15d44a7b5fc550808f52
Signed-off-by: Hyunseok Yang <hs0219.yang@samsung.com>
src/controls/FWebCtrl_UserConfirmPopup.cpp
src/controls/FWebCtrl_WebImpl.cpp
src/controls/FWebCtrl_WebImpl.h

index 287cb39..5dd549a 100755 (executable)
@@ -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);
+               }
        }
 }
 
index 1400c76..566a4d3 100755 (executable)
@@ -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;
index a2bf268..4ee1700 100755 (executable)
@@ -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<AuthenticationChallenge> __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;