#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"
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
String msg(pMessage);
- MessageBox messageBox;
- r = messageBox.Construct(L"", msg, MSGBOX_STYLE_OKCANCEL);
+ r = pImpl->ShowUserConfirmPopup(USER_SCRIPT_CONFIRM, pView, msg);
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));
-
- 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;
}
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:
{
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)
ewk_certificate_policy_decision_allowed_set(pPolicy, EINA_FALSE);
pImpl->SetCertificateConfirmed(false);
pImpl->SetCertificateRequested(true);
+
+ ewk_view_resume(pWebCore->GetWebNativeNode());
}
{
ewk_policy_decision_ignore(pPolicy);
- _SelectBox selectBox;
- int selectedIndex = 0;
String operationId(L"http://tizen.org/appcontrol/operation/view");
r = _AppControlImpl::FindAndStart(operationId, &url, &mime, null, null, null);
if (r == E_OBJ_NOT_FOUND)
{
- r = selectBox.Construct(false, L"Select application", 1); //+1 for Downloader
- 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));
- selectBox.AddListItem(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_DOWNLOAD"), _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
- r = selectBox.ShowAndWait(selectedIndex);
+ r = pSelectBox->Construct(false, L"Select application", 1, null, url);
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()));
-
- r = pManagerImpl->Start(request, reqId);
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
+ 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));
}
return;
return;
}
- _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
- if (pFormCore)
+ _FormImpl* pFormImpl = pImpl->GetParentFormImpl(dynamic_cast< _ControlImpl* >(pImpl));
+ if (pFormImpl)
{
- pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
+ pFormImpl->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
- if (pFormCore->HasFooter())
+ if (pFormImpl->HasFooter())
{
- pFormCore->SetKeypadShowState(true);
- pFormCore->Draw();
+ pFormImpl->GetCore().SetKeypadShowState(true);
+ pFormImpl->Draw();
}
}
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl, "Failed to request");
- _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
- if (pFormCore)
+ _FormImpl* pFormImpl = pImpl->GetParentFormImpl(dynamic_cast< _ControlImpl* >(pImpl));
+ if (pFormImpl)
{
- pFormCore->DeflateClientRectHeight(0);
+ pFormImpl->DeflateClientRectHeight(0);
- if (pFormCore->HasFooter())
+ if (pFormImpl->HasFooter())
{
- pFormCore->SetKeypadShowState(false);
- pFormCore->Draw();
+ pFormImpl->GetCore().SetKeypadShowState(false);
+ pFormImpl->Draw();
}
}
, __pGeolocationConfirmPopup(null)
, __pNotificationConfirmPopup(null)
, __pScriptAlertConfirmPopup(null)
+ , __pScriptConfirmPopup(null)
, __pAppCacheConfirmPopup(null)
, __pDbQuotaConfirmPopup(null)
, __pLocalFsQuotaConfirmPopup(null)
, __policy(WEB_DECISION_CONTINUE)
, __defaultUserAgent(L"")
, __pFormDataList(null)
+ , __popupClosed(false)
{
__textSearch.__searchAll = false;
__textSearch.__searchForward = true;
_WebImpl::~_WebImpl()
{
- _WebManager* pWebManager = _WebManager::GetInstance();
- pWebManager->RemoveWeb(reinterpret_cast< int >(this));
-
- _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
- pManagerImpl->SetDownloadListener(null);
-
- RemoveEventListenerCallback();
ClearCertificateDb();
}
__pWebCore = dynamic_cast< _Web* >(&(GetCore()));
SysTryReturnResult(NID_WEB_CTRL, __pWebCore, E_SYSTEM, "A system error has been occurred. Failed to get web control");
- _WebManager* pWebManager = _WebManager::GetInstance();
- pWebManager->AddWeb(reinterpret_cast< int >(this));
-
return E_SUCCESS;
}
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);
std::unique_ptr< _PromptPopup > pPromptPopup(new (std::nothrow) _PromptPopup());
SysTryReturnResult(NID_WEB_CTRL, pPromptPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
- r = pPromptPopup->Construct(msg, defVal, __pWebCore->GetWebNativeNode());
+ r = pPromptPopup->Construct(msg, defVal, __pWebCore->GetWebNativeNode(), this);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pPromptPopup = std::move(pPromptPopup);
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, true, msg);
+ r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, this, true, msg);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
int modalResult = 0;
{
case USER_CONTENT_HANDLER:
{
- __pContentHandlerConfirmPopup.reset();
-
__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;
}
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));
+
+ __pProtocolHandlerConfirmPopup.reset();
+
+ ewk_view_resume(__pWebCore->GetWebNativeNode());
+
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));
+
+ __pAppCacheConfirmPopup.reset();
+
+ ewk_view_resume(__pWebCore->GetWebNativeNode());
+
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));
+
+ __pDbQuotaConfirmPopup.reset();
+
+ ewk_view_resume(__pWebCore->GetWebNativeNode());
+
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));
+
+ __pLocalFsQuotaConfirmPopup.reset();
+
+ ewk_view_resume(__pWebCore->GetWebNativeNode());
+
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));
+
+ __pIndexedDbQuotaConfirmPopup.reset();
+
+ 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:
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, false, msg);
+ r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, this, false, msg);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
switch(userConfirmMode)
}
-_Form*
-_WebImpl::GetParentFormCore(_Control* pControlCore)
+_FormImpl*
+_WebImpl::GetParentFormImpl(_ControlImpl* pControlImpl)
{
String parentName;
- _Form* pFormCore = null;
+ _FormImpl* pFormImpl = null;
- _Control* pParentControlCore = dynamic_cast< _Control* >(pControlCore->GetParent());
- if (!pParentControlCore)
+ _ControlImpl* pParentControlImpl = dynamic_cast< _ControlImpl* >(pControlImpl->GetParent());
+ if (!pParentControlImpl)
{
return null;
}
- pFormCore = dynamic_cast< _Form* >(pParentControlCore);
- if (pFormCore)
+ pFormImpl = dynamic_cast< _FormImpl* >(pParentControlImpl);
+ if (pFormImpl)
{
- return pFormCore;
+ return pFormImpl;
}
- return GetParentFormCore(pParentControlCore);
+ return GetParentFormImpl(pParentControlImpl);
}
bool
_WebImpl::OnFocusGained(const _ControlImpl& source)
{
+ 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;
}
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 false;
{
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::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::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);
}
}
_WebImpl::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
{
_ContainerImpl::OnUserEventReceivedN(requestId, pArgs);
-
+
switch (requestId)
{
case ID_CERTIFICATE_CONFIRM_POPUP_CLOSE:
case ID_USER_SCRIPT_ALERT_CLOSE:
__pScriptAlertConfirmPopup.reset();
break;
+ case ID_USER_SCRIPT_CONFIRM_CLOSE:
+ __pScriptConfirmPopup.reset();
+ break;
default:
break;
}