X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontrols%2FFWebCtrl_UserConfirmPopup.cpp;h=5f6543bc731cc43e45180c4bde1ae9eda8b10c5e;hb=497bab034793d5aed357041a51e867dadbc27475;hp=fe2f5e393e920f9eb834ddf076728fa8a962d138;hpb=0a1a139f4a62767a9ea5792ec475c9f248bdae44;p=framework%2Fosp%2Fweb.git diff --git a/src/controls/FWebCtrl_UserConfirmPopup.cpp b/src/controls/FWebCtrl_UserConfirmPopup.cpp index fe2f5e3..5f6543b 100755 --- a/src/controls/FWebCtrl_UserConfirmPopup.cpp +++ b/src/controls/FWebCtrl_UserConfirmPopup.cpp @@ -19,6 +19,7 @@ * @file FWebCtrl_UserConfirmPopup.cpp * @brief The file contains the definition of _UserConfirmPopup class. */ +#include #include #include #include @@ -64,17 +65,23 @@ _UserConfirmPopup::_UserConfirmPopup(void) , __userConfirmMode(USER_CONFIRM_USERMEDIA) , __pCheckButton(null) , __sync(false) + , __pImpl(null) { } _UserConfirmPopup::~_UserConfirmPopup(void) { + + if (IsModalPopup()) + { + HandleUserAction(EINA_FALSE); + } } result -_UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo, bool sync, String msg) +_UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo, Tizen::Web::Controls::_WebImpl* pImpl, bool sync, String msg) { result r = E_SUCCESS; SysTryReturnResult(NID_WEB_CTRL, pEventInfo, E_INVALID_ARG, "Invalid argument(s) is used. pPolicy is null."); @@ -94,6 +101,9 @@ _UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo, bool hasTitle = true; int popupMaxHeight = 2*pPopupData->labelDim.height + pPopupData->btnDim.height + 2*pPopupData->sideMargin; + __pImpl = pImpl; + SysAssertf(__pImpl != null, "Failed to get _WebImpl"); + if (__userConfirmMode == USER_CONFIRM_GEOLOCATION) { popupMaxHeight += pPopupData->checkDim.height; @@ -169,16 +179,17 @@ _UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo, r = titleList.Construct(); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW))); if (userConfirmMode == USER_SCRIPT_ALERT) { + idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW))); titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK")))); } else { idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL))); - titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_OPT_ALLOW")))); + idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW))); titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_OPT_CANCEL")))); + titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_OPT_ALLOW")))); } r = CreateAndAddButtons(idList, titleList, pButtonPanel); @@ -235,22 +246,27 @@ _UserConfirmPopup::OnActionPerformed(const Control& source, int actionId) { case USER_CONFIRM_USERMEDIA: { - GetOwner()->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null); break; } case USER_CONFIRM_GEOLOCATION: { - GetOwner()->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null); break; } case USER_CONFIRM_NOTIFICATION: { - GetOwner()->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null); break; } case USER_SCRIPT_ALERT: { - GetOwner()->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null); + break; + } + case USER_SCRIPT_CONFIRM: + { + __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null); break; } default: @@ -367,6 +383,12 @@ CATCH: ewk_view_javascript_alert_reply(pView); break; } + case USER_SCRIPT_CONFIRM: + { + Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData); + ewk_view_javascript_confirm_reply(pView, allow); + break; + } case USER_CONFIRM_APP_CACHE: { Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData); @@ -495,7 +517,7 @@ _UserConfirmPopup::RegisterHandler(bool checkHandler, Eina_Bool allow) bool _UserConfirmPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo) { - return true; + return false; } bool @@ -516,22 +538,27 @@ _UserConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventIn { case USER_CONFIRM_USERMEDIA: { - GetOwner()->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null); break; } case USER_CONFIRM_GEOLOCATION: { - GetOwner()->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null); break; } case USER_CONFIRM_NOTIFICATION: { - GetOwner()->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null); break; } case USER_SCRIPT_ALERT: { - GetOwner()->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null); + __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null); + break; + } + case USER_SCRIPT_CONFIRM: + { + __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null); break; } case USER_PROTOCOL_HANDLER: @@ -545,7 +572,7 @@ _UserConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventIn SysAssert(false); } } - return true; + return false; } bool