_WebPopupData* pPopupData = _WebPopup::GetPopupData();
SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- listMaxHeihgt = listCount * listItemHeight + pPopupData->panelHeight;
+ listMaxHeihgt = listCount * listItemHeight;
rect.height = listMaxHeihgt;
rect.width = pPopupData->popupDim.width;
__pListView = pListView.release();
- Panel* pButtonPanel = CreateAndAddPanel();
- SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+ if (__multiSelection)
+ {
+ Panel* pButtonPanel = CreateAndAddPanel();
+ SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- _SystemResource* pSysResource = _SystemResource::GetInstance();
- SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
+ SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
- ArrayList idList;
- r = idList.Construct();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ ArrayList idList;
+ r = idList.Construct();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- idList.Add(*(new Integer(ID_BUTTON_CANCEL)));
- if (__multiSelection)
- {
idList.Add(*(new Integer(ID_BUTTON_SELECTION)));
- }
- ArrayList titleList;
- r = titleList.Construct();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ ArrayList titleList;
+ r = titleList.Construct();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB"))));
- if (__multiSelection)
- {
titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
__pToggledArray = eina_inarray_new(sizeof(int), 0);
SysTryReturnResult(NID_WEB_CTRL, __pToggledArray, E_OUT_OF_MEMORY, "Memory Allocation failed.");
- }
- r = CreateAndAddButtons(idList, titleList, pButtonPanel);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = CreateAndAddButtons(idList, titleList, pButtonPanel);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
SetPropagatedKeyEventListener(this);
idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
}
+ else if (userConfirmMode == USER_BEFORE_UNLOAD_CONFIRM)
+ {
+ idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL)));
+ idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
+ titleList.Add(*(new String(L"Leave")));
+ titleList.Add(*(new String(L"Stay")));
+ }
else
{
idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL)));
__pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
break;
}
+ case USER_BEFORE_UNLOAD_CONFIRM:
+ {
+ __pImpl->SendUserEvent(ID_USER_BEFORE_UNLOAD_CONFIRM_CLOSE, null);
+ break;
+ }
default:
SysAssert(false);
}
ewk_view_javascript_confirm_reply(pView, allow);
break;
}
+ case USER_BEFORE_UNLOAD_CONFIRM:
+ {
+ Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
+ ewk_view_before_unload_confirm_panel_reply(pView, !allow);
+ break;
+ }
case USER_CONFIRM_APP_CACHE:
{
Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
__pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
break;
}
+ case USER_BEFORE_UNLOAD_CONFIRM:
+ {
+ __pImpl->SendUserEvent(ID_USER_BEFORE_UNLOAD_CONFIRM_CLOSE, null);
+ break;
+ }
case USER_PROTOCOL_HANDLER:
case USER_CONTENT_HANDLER:
case USER_CONFIRM_APP_CACHE:
static const int PORTRAIT_KEYPAD_HEIGHT = 444;
static const int LANDSCAPE_KEYPAD_HEIGHT = 316;
-static const int DEFAULT_LIST_ITEM_COUNT = 4;
+static const int DEFAULT_LIST_ITEM_COUNT = 5;
Eina_Bool
}
+Eina_Bool
+_WebImpl::OnBeforeUnloadConfirmRequested(Evas_Object* pView, const char* pMessage, void* pUserData)
+{
+ _WebImpl* pWebImpl = reinterpret_cast< _WebImpl* >(pUserData);
+ SysAssertf(pWebImpl, "Failed to request");
+ result r = E_SUCCESS;
+
+ String msg(pMessage);
+
+ r = pWebImpl->ShowUserConfirmPopupAsync(USER_BEFORE_UNLOAD_CONFIRM, pView, msg);
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ return EINA_TRUE;
+
+CATCH:
+ ewk_view_javascript_confirm_reply(pView, EINA_FALSE);
+ return EINA_TRUE;
+}
+
+
void
OnCertificateRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
{
if (code >= REDIRECTION_HEADER_GROUP && code < REDIRECTION_HEADER_GROUP + 100)
{
pImpl->SetRedirectRequested(true);
- mime = L"";
}
ILoadingListener* pLoadingListener = pImpl->GetLoadingListener();
SysSecureLog(NID_WEB_CTRL, "The current value of key is %ls, value is %ls", key.GetPointer(), value.GetPointer());
r = httpHeader.AddField(key, value);
- SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, eina_iterator_free(iterator), r, "[%s] Propagating.", GetErrorMessage(r));
}
eina_iterator_free(iterator);
, __pNotificationConfirmPopup(null)
, __pScriptAlertConfirmPopup(null)
, __pScriptConfirmPopup(null)
+ , __pBeforeUnloadConfirmPopup(null)
, __pAppCacheConfirmPopup(null)
, __pDbQuotaConfirmPopup(null)
, __pLocalFsQuotaConfirmPopup(null)
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(this, isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT, pWebView);
+ if (isMultiSelect)
+ {
+ r = pSelectBox->Construct(this, isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT - 1, pWebView);
+ }
+ else
+ {
+ r = pSelectBox->Construct(this, 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);
ewk_view_javascript_alert_callback_set(pWebNativeNode, OnScriptAlertRequested, const_cast< _WebImpl* >(this));
ewk_view_javascript_prompt_callback_set(pWebNativeNode, OnScriptPromptRequested, const_cast< _WebImpl* >(this));
ewk_view_javascript_confirm_callback_set(pWebNativeNode, OnScriptConfirmRequested, const_cast< _WebImpl* >(this));
+ ewk_view_before_unload_confirm_panel_callback_set(pWebNativeNode, OnBeforeUnloadConfirmRequested, const_cast< _WebImpl* >(this));
evas_object_smart_callback_add(pWebNativeNode, "policy,response,decide", OnWebDataReceived, this);
ewk_view_javascript_alert_callback_set(pWebNativeNode, null, null);
ewk_view_javascript_prompt_callback_set(pWebNativeNode, null, null);
ewk_view_javascript_confirm_callback_set(pWebNativeNode, null, null);
+ ewk_view_before_unload_confirm_panel_callback_set(pWebNativeNode, null, null);
evas_object_smart_callback_del(pWebNativeNode, "policy,response,decide", OnWebDataReceived);
break;
}
+ case USER_BEFORE_UNLOAD_CONFIRM:
+ {
+ __pBeforeUnloadConfirmPopup.reset();
+
+ __pBeforeUnloadConfirmPopup = std::move(pUserConfirmPopup);
+
+ r = __pBeforeUnloadConfirmPopup->ShowPopup();
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pBeforeUnloadConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ break;
+ }
default:
break;
}
r = InitializeSetting();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- SettingInfo::AddSettingEventListener(*this);
+ _SettingInfoImpl::AddSettingEventListener(*this);
_WebManager* pWebManager = _WebManager::GetInstance();
pWebManager->AddWeb(reinterpret_cast< int >(this));
case ID_USER_SCRIPT_CONFIRM_CLOSE:
__pScriptConfirmPopup.reset();
break;
+
+ case ID_USER_BEFORE_UNLOAD_CONFIRM_CLOSE:
+ __pBeforeUnloadConfirmPopup.reset();
+ break;
+
case ID_USER_SCRIPT_SELECTBOX_CLOSE:
__pSelectBox.reset();
break;
USER_CONFIRM_NOTIFICATION,
USER_SCRIPT_ALERT,
USER_SCRIPT_CONFIRM,
+ USER_BEFORE_UNLOAD_CONFIRM,
USER_CONFIRM_APP_CACHE,
USER_CONFIRM_DB_QUOTA_EXCEDED,
USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED,
ID_USER_CONFIRM_NOTIFICATION_CLOSE,
ID_USER_SCRIPT_ALERT_CLOSE,
ID_USER_SCRIPT_CONFIRM_CLOSE,
+ ID_USER_BEFORE_UNLOAD_CONFIRM_CLOSE,
ID_USER_SCRIPT_SELECTBOX_CLOSE
};
virtual void OnSettingChanged(Tizen::Base::String& key);
+ static Eina_Bool OnBeforeUnloadConfirmRequested(Evas_Object* pView, const char* pMessage, void* pUserData);
private:
bool __isFooterVisible;
bool __isKeypadVisible;
std::unique_ptr<_UserConfirmPopup> __pNotificationConfirmPopup;
std::unique_ptr<_UserConfirmPopup> __pScriptAlertConfirmPopup;
std::unique_ptr<_UserConfirmPopup> __pScriptConfirmPopup;
+ std::unique_ptr<_UserConfirmPopup> __pBeforeUnloadConfirmPopup;
std::unique_ptr<_UserConfirmPopup> __pAppCacheConfirmPopup;
std::unique_ptr<_UserConfirmPopup> __pDbQuotaConfirmPopup;
std::unique_ptr<_UserConfirmPopup> __pLocalFsQuotaConfirmPopup;