#include <FBaseRtMutexGuard.h>
#include <FBaseSysLog.h>
#include <FBaseUtilUri.h>
-#include <FCntDownloadRequest.h>
#include <FGrpColor.h>
#include <FGrpPoint.h>
#include <FGrpRectangle.h>
#include <FApp_AppInfo.h>
#include <FApp_AppManagerImpl.h>
#include <FBase_StringConverter.h>
-#include <FCnt_DownloadManagerImpl.h>
-#include <FCnt_ContentManagerImpl.h>
#include <FGrp_CoordinateSystem.h>
#include <FGrp_Screen.h>
#include <FIo_DatabaseImpl.h>
#include <FIo_NormalFile.h>
+#include <FSys_SettingInfoImpl.h>
#include <FSys_SystemResource.h>
#include <FSys_VibratorImpl.h>
#include <FUi_Control.h>
#include <FUi_CoordinateSystemUtils.h>
#include <FUi_EcoreEvasMgr.h>
#include <FUi_EcoreEvas.h>
+#include <FUi_ResourceManager.h>
#include <FUi_ResourceSizeInfo.h>
#include <FUi_Window.h>
#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"
#include "FWebCtrl_WebEvent.h"
#include "FWebCtrl_WebEventArg.h"
#include "FWebCtrl_WebImpl.h"
+#include "FWebCtrl_WebManager.h"
#include "FWebCtrl_WebPresenter.h"
#include "FWebCtrl_WebSettingImpl.h"
static const int PORTRAIT_KEYPAD_HEIGHT = 444;
static const int LANDSCAPE_KEYPAD_HEIGHT = 316;
-static const int DEFAULT_LIST_ITEM_COUNT = 4;
-
-
-Eina_Bool
-AddHttpHeaderData(const Eina_Hash* pHash, const void* pKey, void* pValue, void* pUserData)
-{
- result r = E_SUCCESS;
-
- String key(reinterpret_cast< const char* >(pKey));
- String value(reinterpret_cast< char* >(pValue));
-
- SysLog(NID_WEB_CTRL, "The current value of key is %ls, value is %ls", key.GetPointer(), value.GetPointer());
-
- r = reinterpret_cast< HttpHeader* >(pUserData)->AddField(key, value);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return EINA_TRUE;
-}
+static const int DEFAULT_LIST_ITEM_COUNT = 5;
Eina_Bool
std::unique_ptr<String> pAttrValue(new (std::nothrow) String(reinterpret_cast< char* >(pValue)));
SysTryReturn(NID_WEB_CTRL, pAttrKey.get() && pAttrValue.get(), EINA_FALSE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- SysLog(NID_WEB_CTRL, "The current value of key is %ls, value is %ls", pAttrKey->GetPointer(), pAttrValue->GetPointer());
+ SysSecureLog(NID_WEB_CTRL, "The current value of key is %ls, value is %ls", pAttrKey->GetPointer(), pAttrValue->GetPointer());
r = reinterpret_cast< HashMap* >(pUserData)->Add(*pAttrKey, *pAttrValue);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
String msg(pMessage);
- MessageBox messageBox;
- r = messageBox.Construct(L"", msg, MSGBOX_STYLE_OKCANCEL);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
- int modalResult = 0;
-
- messageBox.SetOwner(&pImpl->GetPublic());
-
- 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);
- }
+ r = pImpl->ShowUserConfirmPopupAsync(USER_SCRIPT_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;
}
CATCH:
ewk_view_javascript_prompt_reply(pView, null);
- return EINA_FALSE;
+ return EINA_TRUE;
+}
+
+
+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;
}
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());
}
- pImpl->SetCertificateRequested(true);
+ if (pImpl)
+ {
+ pImpl->SetCertificateRequested(true);
+ }
break;
}
case WEB_CERTIFICATE_ERROR_HANDLING_MODE_CANCEL:
ewk_certificate_policy_decision_allowed_set(pPolicy, EINA_FALSE);
pImpl->SetCertificateConfirmed(false);
pImpl->SetCertificateRequested(true);
+
+ ewk_view_resume(pWebCore->GetWebNativeNode());
}
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl , "Failed to request");
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
+ SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+
const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
String msg;
- result r = msg.Format(256, L"Allow %s to use offline application cache?", pHostName);
+ result r = msg.Format(256, pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE").GetPointer(), _StringConverter::CopyToCharArrayN(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_THIS_WEBPAGE")), pHostName);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_APP_CACHE, pView, msg);
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl , "Failed to request");
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
+ SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+
const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
String msg;
- result r = msg.Format(512, L"%s Used %lld of storage. Allow %s to use upto 2GB of indexed db?", pHostName, currentQuota, pHostName);
+ result r = msg.Format(512, pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE").GetPointer(), _StringConverter::CopyToCharArrayN(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_THIS_WEBPAGE")), pHostName);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED, pView, msg);
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl , "Failed to request");
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
+ SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+
const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
String msg;
- result r = msg.Format(512, L"Allow %s to open %s use upto %lld of web database?", pHostName, database_name, expectedQuota);
+ result r = msg.Format(512, pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE").GetPointer(), _StringConverter::CopyToCharArrayN(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_THIS_WEBPAGE")), pHostName);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_DB_QUOTA_EXCEDED, pView, msg);
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl , "Failed to request");
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
+ SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+
const char* pHostName = ewk_security_origin_host_get(pSecOrigin);
String msg;
- result r = msg.Format(512, L"%s Used %lld of storgae. Allow %s to use upto 2GB of file system?", pHostName, currentQuota, pHostName);
+ result r = msg.Format(512, pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE").GetPointer(), _StringConverter::CopyToCharArrayN(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_THIS_WEBPAGE")), pHostName);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED, pView, msg);
OnFullScreenEntered(void* pUserData, Evas_Object* pView, void* pEventInfo)
{
_WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ bool* pIsHandleNeeded = reinterpret_cast< bool* >(pEventInfo);
SysAssertf(pImpl, "Failed to request");
- SysLog(NID_WEB_CTRL, "Enter.");
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ SysAssertf(pWebCore, "Failed to get Web core object");
+
+ if (pIsHandleNeeded && *pIsHandleNeeded)
+ {
+ pWebCore->SetFullScreenEntered(true);
+ }
}
_WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
SysAssertf(pImpl, "Failed to request");
- SysLog(NID_WEB_CTRL, "Exit.");
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ SysAssertf(pWebCore, "Failed to get Web core object");
+
+ pWebCore->SetFullScreenEntered(false);
+}
+
+
+void
+OnFocusDownRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ SysAssertf(pImpl, "Failed to request");
+
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ pWebCore->SetFocusEnd(true);
+}
+
+
+void
+OnFocusUpRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ SysAssertf(pImpl, "Failed to request");
+
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ pWebCore->SetFocusEnd(true);
}
String url(ewk_policy_decision_url_get(pPolicy));
SysSecureLog(NID_WEB_CTRL, "The current value of url is %ls", url.GetPointer());
- if (url == L"about:blank")
- {
- ewk_policy_decision_use(pPolicy);
- return;
- }
-
- if (pImpl->GetLoadingListener() && ewk_frame_is_main_frame(ewk_policy_decision_frame_get(pPolicy))
+ if (ewk_frame_is_main_frame(ewk_policy_decision_frame_get(pPolicy))
&& !pImpl->IsRedirectRequested())
{
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ SysAssertf(pWebCore, "Failed to get Web core object");
+
+ pWebCore->SetFullScreenEntered(false);
+
pImpl->SetCertificateRequested(false);
if (pImpl->GetTextSearchListener())
{
pImpl->DisableAsyncSearch();
}
-
- WebNavigationType navigationType = WEB_NAVIGATION_OTHER;
- Ewk_Policy_Navigation_Type ewkNavigationType = ewk_policy_decision_navigation_type_get(pPolicy);
- switch (ewkNavigationType)
+ ILoadingListener* pLoadingListener = pImpl->GetLoadingListener();
+ if (pLoadingListener)
{
- case EWK_POLICY_NAVIGATION_TYPE_LINK_CLICKED:
- navigationType = WEB_NAVIGATION_LINK_CLICKED;
- break;
- case EWK_POLICY_NAVIGATION_TYPE_FORM_SUBMITTED:
- navigationType = WEB_NAVIGATION_FORM_SUBMITTED;
- break;
- case EWK_POLICY_NAVIGATION_TYPE_BACK_FORWARD:
- navigationType = WEB_NAVIGATION_BACKFORWARD;
- break;
- case EWK_POLICY_NAVIGATION_TYPE_RELOAD:
- navigationType = WEB_NAVIGATION_RELOAD;
- break;
- case EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED:
- navigationType = WEB_NAVIGATION_FORM_RESUBMITTED;
- break;
- case EWK_POLICY_NAVIGATION_TYPE_OTHER:
- navigationType = WEB_NAVIGATION_OTHER;
- break;
- default:
- SysAssert(false);
- }
+ WebNavigationType navigationType = WEB_NAVIGATION_OTHER;
+ Ewk_Policy_Navigation_Type ewkNavigationType = ewk_policy_decision_navigation_type_get(pPolicy);
- if (pImpl->GetLoadingListener()->OnLoadingRequested(url, navigationType))
- {
- ewk_policy_decision_ignore(pPolicy);
+ switch (ewkNavigationType)
+ {
+ case EWK_POLICY_NAVIGATION_TYPE_LINK_CLICKED:
+ navigationType = WEB_NAVIGATION_LINK_CLICKED;
+ break;
+ case EWK_POLICY_NAVIGATION_TYPE_FORM_SUBMITTED:
+ navigationType = WEB_NAVIGATION_FORM_SUBMITTED;
+ break;
+ case EWK_POLICY_NAVIGATION_TYPE_BACK_FORWARD:
+ navigationType = WEB_NAVIGATION_BACKFORWARD;
+ break;
+ case EWK_POLICY_NAVIGATION_TYPE_RELOAD:
+ navigationType = WEB_NAVIGATION_RELOAD;
+ break;
+ case EWK_POLICY_NAVIGATION_TYPE_FORM_RESUBMITTED:
+ navigationType = WEB_NAVIGATION_FORM_RESUBMITTED;
+ break;
+ case EWK_POLICY_NAVIGATION_TYPE_OTHER:
+ navigationType = WEB_NAVIGATION_OTHER;
+ break;
+ default:
+ SysAssert(false);
+ }
- return;
+ if (pLoadingListener->OnLoadingRequested(url, navigationType))
+ {
+ ewk_policy_decision_ignore(pPolicy);
+
+ return;
+ }
}
}
+ if (url == L"about:blank")
+ {
+ ewk_policy_decision_use(pPolicy);
+
+ return;
+ }
+
String currentUrl(pImpl->GetUrl());
String redirectUrl(pImpl->GetProtocolFromUri(url, currentUrl));
if (redirectUrl != L"")
{
- pImpl->LoadUrl(redirectUrl);
ewk_policy_decision_ignore(pPolicy);
+ pImpl->LoadUrl(redirectUrl);
+
return;
}
uri.SetUri(url);
String uriScheme(uri.GetScheme());
- SysLog(NID_WEB_CTRL, "The current value of scheme is %ls", uriScheme.GetPointer());
+ SysSecureLog(NID_WEB_CTRL, "The current value of scheme is %ls", uriScheme.GetPointer());
- if ((uriScheme != L"http") && (uriScheme != L"https") && (uriScheme != L"file"))
+ if ((uriScheme != L"http") && (uriScheme != L"https") && (uriScheme != L"file") && (uriScheme != L""))
{
- ewk_policy_decision_ignore(pPolicy);
-
- if (uriScheme == L"")
- {
- return;
- }
-
result r = E_SUCCESS;
if (uriScheme == L"tel")
else
{
String operationId(L"http://tizen.org/appcontrol/operation/view");
- String mime(ewk_policy_decision_response_mime_get(pPolicy));
- r = _AppControlImpl::FindAndStart(operationId, &url, &mime, null, null, null);
+ r = _AppControlImpl::FindAndStart(operationId, &url, null, null, null, null);
}
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- return;
+ if (r == E_SUCCESS)
+ {
+ ewk_policy_decision_ignore(pPolicy);
+
+ return;
+ }
}
ewk_policy_decision_use(pPolicy);
result r = E_SUCCESS;
- _SystemResource* pSysResource = _SystemResource::GetInstance();
- SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
-
- const char* pUrl = ewk_policy_decision_url_get(pPolicy);
int code = ewk_policy_decision_response_status_code_get(pPolicy);
- String mime(ewk_policy_decision_response_mime_get(pPolicy));
- SysSecureLog(NID_WEB_CTRL, "url : %s, mime : %ls, code : %d", pUrl, mime.GetPointer(), code);
-
- ILoadingListener* pLoadingListener = pImpl->GetLoadingListener();
-
String url(ewk_policy_decision_url_get(pPolicy));
+ String mime(ewk_policy_decision_response_mime_get(pPolicy));
+ SysSecureLog(NID_WEB_CTRL, "code : %d, url : %ls, mime : %ls", code, url.GetPointer(), mime.GetPointer());
- if (pLoadingListener && ewk_frame_is_main_frame(ewk_policy_decision_frame_get(pPolicy)))
+ if (ewk_frame_is_main_frame(ewk_policy_decision_frame_get(pPolicy)))
{
- const Eina_Hash* pHeader = ewk_policy_decision_response_headers_get(pPolicy);
-
- DecisionPolicy policy;
- HttpHeader httpHeader;
-
if (code >= REDIRECTION_HEADER_GROUP && code < REDIRECTION_HEADER_GROUP + 100)
{
pImpl->SetRedirectRequested(true);
- mime = L"";
}
- eina_hash_foreach(pHeader, AddHttpHeaderData, &httpHeader);
- SysTryCatch(NID_WEB_CTRL, GetLastResult() == E_SUCCESS, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ ILoadingListener* pLoadingListener = pImpl->GetLoadingListener();
+ if (pLoadingListener)
+ {
+ HttpHeader httpHeader;
+
+ Eina_Iterator* iterator = eina_hash_iterator_tuple_new(ewk_policy_decision_response_headers_get(pPolicy));
+ if (iterator)
+ {
+ Eina_Hash_Tuple *tuple = null;
- policy = pLoadingListener->OnWebDataReceived(mime, httpHeader);
- pImpl->SetPolicyDecision(policy);
+ EINA_ITERATOR_FOREACH(iterator, tuple)
+ {
+ String key(reinterpret_cast< const char* >(tuple->key));
+ String value(reinterpret_cast< char* >(tuple->data));
+
+ 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, eina_iterator_free(iterator), r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ eina_iterator_free(iterator);
+ }
+
+ pImpl->SetPolicyDecision(pLoadingListener->OnWebDataReceived(mime, httpHeader));
+ }
+ else
+ {
+ pImpl->SetPolicyDecision(WEB_DECISION_CONTINUE);
+ }
}
switch (pImpl->GetPolicyDecision())
String redirectUrl(pImpl->GetRedirectUri(url, currentUrl, mime));
if (redirectUrl != L"")
{
- pImpl->LoadUrl(redirectUrl);
ewk_policy_decision_ignore(pPolicy);
+ pImpl->LoadUrl(redirectUrl);
+
return;
}
- if (pImpl->IsMimeSupported(mime) || mime == L"")
+ if (ewk_policy_decision_type_get(pPolicy) == EWK_POLICY_DECISION_USE)
{
break;
}
-
else
{
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);
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS || r == E_OBJ_NOT_FOUND, r, "[%s] Propagating.", GetErrorMessage(r));
-
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));
+ String operationId(L"http://tizen.org/appcontrol/operation/download");
- selectBox.AddListItem(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_DOWNLOAD"), _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
- r = selectBox.ShowAndWait(selectedIndex);
+ r = _AppControlImpl::FindAndStart(operationId, &url, null, null, null, null);
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));
- }
}
return;
}
break;
}
+
case WEB_DECISION_DOWNLOAD:
{
ewk_policy_decision_ignore(pPolicy);
Ewk_Context* pContext = ewk_view_context_get(pView);
SysAssertf(pContext, "Failed to get webkit instance.");
- pDownloadHandler->StartDownload(pUrl);
+ pDownloadHandler->StartDownload(url);
return;
}
+
case WEB_DECISION_IGNORE:
{
ewk_policy_decision_ignore(pPolicy);
return;
}
+
default:
{
SysAssert(false);
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
pEventArg.release();
}
-
}
SysTryReturnResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
pImpl->GetBlockRange(*startPoint.get(), *endPoint.get());
-
if ((endPoint->x != 0.0f) && (endPoint->y != 0.0f))
{
std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED_FLOAT));
void
-OnWebPageBlockSelectedByOrientation(void* pUserData, Evas_Object* pView, void* pEventInfo)
-{
- _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
- SysAssertf(pImpl, "Failed to request");
-
- if (!pImpl->IsOrientationChanged())
- {
- return;
- }
-
- pImpl->SetOrientationChanged(false);
-
- int orientation = 0;
- _ControlRotation rotation = _ControlManager::GetInstance()->GetOrientationStatus();
- switch (rotation)
- {
- case _CONTROL_ROTATION_0:
- orientation = 0;
- break;
- case _CONTROL_ROTATION_90:
- orientation = 90;
- break;
- case _CONTROL_ROTATION_180:
- orientation = 180;
- break;
- case _CONTROL_ROTATION_270:
- orientation = -90;
- break;
- }
- ewk_view_orientation_send(pView, orientation);
-
- OnWebPageBlockSelected(pUserData, pView, pEventInfo);
-
- SysLog(NID_WEB_CTRL, "Enter.");
-}
-
-
-Eina_Bool
-OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData)
-{
- std::unique_ptr<_MediaSelectionListener> pMediaListener(new (std::nothrow) _MediaSelectionListener());
- SysTryReturn(NID_WEB_CTRL, pMediaListener.get(), EINA_TRUE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- pMediaListener->Construct(pView);
-
- HashMap extraData;
- result r = extraData.Construct();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_TRUE, r, "[%s] Propagating.", GetErrorMessage(r));
-
- String isMultipleSelection(L"single");
- String mode(L"selectionType");
- String type(L"type");
- String fileType = L"*/*";
- String operationId = L"http://tizen.org/appcontrol/operation/pick";
-
- if (multipleFile)
- {
- isMultipleSelection.Append(L"multiple");
- }
-
- if (eina_list_count(pAcceptTypes) == 1)
- {
- String item((char*)eina_list_nth(pAcceptTypes, 0));
- String captureString(pCapture);
-
- if (item.StartsWith("image/",0))
- {
- if (captureString == L"camera")
- {
- fileType = L"image/jpg";
- operationId = L"http://tizen.org/appcontrol/operation/create_content";
- String typeKey = L"http://tizen.org/appcontrol/data/camera/allow_switch";
- String typeVal = L"false";
- extraData.Add(&typeKey, &typeVal);
- }
- else
- {
- fileType = L"image/*";
- String selectKey = L"http://tizen.org/appcontrol/data/selection_mode";
- extraData.Add(&selectKey, &isMultipleSelection);
- }
- }
- else if (item.StartsWith("audio/",0))
- {
- fileType = L"audio/*";
- //TO DO: as microphone is not supported yet. suggest to throw an exception
- //if (captureString == L"microphone")
- //{
- //operationId = L"http://tizen.org/appcontrol/operation/create_content";
- //}
- //else
- //{
- String selectKey = L"http://tizen.org/appcontrol/data/selection_mode";
- extraData.Add(&selectKey, &isMultipleSelection);
- //}
- }
- else if (item.StartsWith("video/",0))
- {
- if (captureString == L"camcorder")
- {
- fileType = L"video/3gpp";
- operationId = L"http://tizen.org/appcontrol/operation/create_content";
- String typeKey = L"http://tizen.org/appcontrol/data/camera/allow_switch";
- String typeVal = L"false";
- extraData.Add(&typeKey, &typeVal);
- }
- else
- {
- fileType = L"video/*";
- String selectKey = L"http://tizen.org/appcontrol/data/selection_mode";
- extraData.Add(&selectKey, &isMultipleSelection);
- }
- }
- }
-
- r = _AppControlImpl::FindAndStart(operationId, null, &fileType, null, &extraData, pMediaListener.get());
- SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pMediaListener.release();
-
- return EINA_TRUE;
-
-CATCH:
- ewk_view_open_panel_reply(pView, null, EINA_FALSE);
- return EINA_TRUE;
-}
-
-
-void
OnHandleJavaScriptRequest(void* pUserData, Evas_Object* pView, void* pEventInfo)
{
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
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())
- {
- pFormCore->SetKeypadShowState(true);
- pFormCore->Draw();
- }
+ pFormImpl->Invalidate(false);
}
if (pImpl->GetWebKeypadEventListener())
pImpl->GetWebKeypadEventListener()->OnWebKeypadWillOpen(*dynamic_cast< Web* >(&pImpl->GetPublic()));
}
}
- pImpl->SetKeypadVisibleState(true);
+
pImpl->SetPreviousKeypadBounds(rect);
}
else
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl, "Failed to request");
+ pImpl->SetKeypadVisibleState(true);
+
+ _FormImpl* pFormImpl = pImpl->GetParentFormImpl(dynamic_cast< _ControlImpl* >(pImpl));
+ if (pFormImpl)
+ {
+ _ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetInverseTransformer();
+ SysAssertf(pXformer, "Failed to get CoordinateTransformer");
+
+ pFormImpl->DeflateClientRectHeight(pXformer->TransformVertical(pImpl->GetPreviousKeypadBounds().height));
+
+ if (pFormImpl->HasFooter())
+ {
+ pFormImpl->GetCore().SetKeypadShowState(true);
+ pFormImpl->Draw();
+ }
+ }
+
if (pImpl->GetWebKeypadEventListener())
{
pImpl->GetWebKeypadEventListener()->OnWebKeypadOpened(*static_cast< Web* >(&pImpl->GetPublic()));
_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)
+ {
+ pFormImpl->DeflateClientRectHeight(0);
+
+ pFormImpl->Invalidate(false);
+
+ if (pFormImpl->HasFooter())
+ {
+ pFormImpl->GetCore().SetKeypadShowState(false);
+ pFormImpl->Draw();
+ }
+ }
+
+ if (pImpl->GetWebKeypadEventListener())
+ {
+ pImpl->GetWebKeypadEventListener()->OnWebKeypadClosed(*dynamic_cast< Web* >(&pImpl->GetPublic()));
+ }
+
+ pImpl->SetKeypadVisibleState(false);
+}
+
+
+void
+OnWindowObjectFocusLost(void* pUserData, Evas_Object* pWin, void* pEvent_info)
+{
+ _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+ SysAssertf(pImpl, "Failed to request");
+
+ pImpl->SetWinFocusLost(true);
+}
+
+
+void
+OnWindowObjectFocusGained(void* pUserData, Evas_Object* pWin, void* pEvent_info)
+{
+ _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+ SysAssertf(pImpl, "Failed to request");
+
+ if (pImpl->IsVisible() == true && pImpl->IsFocused() == true)
{
- pFormCore->DeflateClientRectHeight(0);
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ SysAssertf(pWebCore, "Failed to get Web core object");
- if (pFormCore->HasFooter())
+ if (pImpl->IsWinFocusLost() == true)
{
- pFormCore->SetKeypadShowState(false);
- pFormCore->Draw();
- }
- }
+ Ewk_Settings* pSettings = ewk_view_settings_get(pWebCore->GetWebNativeNode());
+ SysAssertf(pSettings, "Failed to get settings instance.");
- if (pImpl->GetWebKeypadEventListener())
- {
- pImpl->GetWebKeypadEventListener()->OnWebKeypadClosed(*dynamic_cast< Web* >(&pImpl->GetPublic()));
+ if (ewk_settings_clear_text_selection_automatically_get(pSettings) == EINA_FALSE)
+ {
+ ewk_settings_clear_text_selection_automatically_set(pSettings, EINA_TRUE);
+
+ evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
+ }
+ else if (pImpl->IsKeypadOpened() == true)
+ {
+ evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
+ }
+ }
}
- pImpl->SetKeypadVisibleState(false);
+ pImpl->SetWinFocusLost(false);
}
void
-OnWindowObjectFocusGained(void* pUserData, Evas_Object* pWin, void* pEvent_info)
+OnWebNativeNodeFocusGained(void* pUserData, Evas* pCanvas, Evas_Object* pView, void* pEventInfo)
{
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl, "Failed to request");
- if (pImpl->IsKeypadOpened() == true && pImpl->IsVisible() == true)
+ if (pImpl->IsKeypadOpened() == true)
+ {
+ pImpl->SetKeypadOpened(false);
+ }
+ else if (pImpl->IsWinFocusLost() == true && pImpl->IsFocused() == false)
{
_Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
SysAssertf(pWebCore, "Failed to get Web core object");
- evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
+ evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_FALSE);
}
-
- pImpl->SetKeypadOpened(false);
}
void
-OnWebNativeNodeFocusGained(void* pUserData, Evas* pCanvas, Evas_Object* pView, void* pEventInfo)
+OnWebNativeNodeFocusLost(void* pUserData, Evas* pCanvas, Evas_Object* pView, void* pEventInfo)
{
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl, "Failed to request");
- if (pImpl->IsKeypadOpened() == true)
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ SysAssertf(pWebCore, "Failed to get Web core object");
+
+ Eina_Rectangle leftHandle;
+ Eina_Rectangle rightHandle;
+
+ EINA_RECTANGLE_SET(&leftHandle, 0, 0, 0, 0);
+ EINA_RECTANGLE_SET(&rightHandle, 0, 0, 0, 0);
+
+ if (pImpl->IsWinFocusLost() == true && ewk_view_text_selection_range_get(pWebCore->GetWebNativeNode(), &leftHandle, &rightHandle))
{
- pImpl->SetKeypadOpened(false);
+ Ewk_Settings* pSettings = ewk_view_settings_get(pWebCore->GetWebNativeNode());
+ SysAssertf(pSettings, "Failed to get settings instance.");
- pImpl->SetFocused();
+ ewk_settings_clear_text_selection_automatically_set(pSettings, EINA_FALSE);
}
}
SysLog(NID_WEB_CTRL, "result : %ls", result.GetPointer());
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(evas_object_data_get(pView, WEB_CTRL));
- if (pImpl && pImpl->IsPresenterAlived(pPresenter))
+ _WebManager* pWebManager = _WebManager::GetInstance();
+ if (pWebManager->IsValidCallback(reinterpret_cast< int >(pImpl), reinterpret_cast< int >(pPresenter)))
{
pPresenter->EndAsyncProcess(result);
}
, __isFooterVisible(false)
, __isKeypadVisible(false)
, __isKeypadOpened(false)
+ , __isWinFocusLost(false)
, __isLoadingErrorOccurred(false)
, __isRedirectRequested(false)
, __isCertificateRequested(false)
, __isCertificateConfirmed(false)
- , __isOrientationChanged(false)
, __isFormDataVisible(false)
, __keypadBounds(0, 0, 0, 0)
, __pWebCore(null)
, __pGeolocationConfirmPopup(null)
, __pNotificationConfirmPopup(null)
, __pScriptAlertConfirmPopup(null)
+ , __pScriptConfirmPopup(null)
+ , __pBeforeUnloadConfirmPopup(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()
{
- _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
- pManagerImpl->SetDownloadListener(null);
+ _WebManager* pWebManager = _WebManager::GetInstance();
+ SysTryCatch(NID_WEB_CTRL, pWebManager, , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ pWebManager->RemoveWeb(reinterpret_cast< int >(this));
+ pWebManager->RemoveActiveWeb(this);
+
+CATCH:
+ _SettingInfoImpl::RemoveSettingEventListener(*this);
RemoveEventListenerCallback();
ClearCertificateDb();
}
r = __textSearch.__searchQueue.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- r = __callbackList.Construct();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
r = __webNotificationList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = InitWebEvent();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
- SysTryReturn(NID_WEB_CTRL, pManagerImpl, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- pManagerImpl->SetDownloadListener(this);
-
__pWebCore = dynamic_cast< _Web* >(&(GetCore()));
SysTryReturnResult(NID_WEB_CTRL, __pWebCore, E_SYSTEM, "A system error has been occurred. Failed to get web control");
{
std::unique_ptr<char[]> pUrl(_StringConverter::CopyToCharArrayN(url));
SysTryReturn(NID_WEB_CTRL, pUrl.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
+
Eina_Hash* pHttpHeader = ConvertToSlpHeaderN(header);
ewk_view_url_request_set(__pWebCore->GetWebNativeNode(), pUrl.get(), EWK_HTTP_METHOD_GET, pHttpHeader, 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(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);
__pSelectBox = std::move(pSelectBox);
- __pSelectBox->SetOwner(&GetPublic());
-
return __pSelectBox->ShowPopup();
}
__pSelectBox.reset();
+ Resume();
+
return E_SUCCESS;
}
return null;
}
- result r = E_SUCCESS;
-
std::unique_ptr<char[]> pScript(_StringConverter::CopyToCharArrayN(scriptCode));
SysTryReturn(NID_WEB_CTRL, pScript.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter());
+ std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this));
SysTryReturn(NID_WEB_CTRL, pPresenter.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- r = __callbackList.Add(pPresenter.get());
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
-
ewk_view_script_execute(pView, pScript.get(), OnScriptExecuted, pPresenter.get());
- std::unique_ptr<String> pResult(new (std::nothrow) String(L""));
- SysTryReturn(NID_WEB_CTRL, pResult.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- pPresenter->WaitAsyncProcess(*pResult.get());
-
- r = __callbackList.Remove(*pPresenter.get());
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
- pPresenter.release();
-
- return pResult.release();
-}
+ String* pResult = new (std::nothrow) String(L"");
+ SysTryReturn(NID_WEB_CTRL, pResult, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ pPresenter->WaitAsyncProcess(*pResult);
-bool
-_WebImpl::IsPresenterAlived(_WebPresenter* pPresenter) const
-{
- return __callbackList.Contains(*pPresenter);
+ return pResult;
}
condition = static_cast < Ewk_Find_Options >(condition | EWK_FIND_OPTIONS_BACKWARDS);
}
- _WebPresenter presenter;
- presenter.InitAsyncProcess();
+ std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this));
+ SysTryReturn(NID_WEB_CTRL, pPresenter.get(), false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- r = SynchronizeSearch(SEARCH_SYNC, pView, condition, text, searchForward, false, &presenter);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = SynchronizeSearch(SEARCH_SYNC, pView, condition, text, searchForward, false, pPresenter.get());
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
int result = 0;
- presenter.WaitAsyncProcess(result);
+ pPresenter->WaitAsyncProcess(result);
return static_cast < bool >(result);
}
Ewk_Cookie_Manager* pCookieManager = ewk_context_cookie_manager_get(pContext);
SysAssertf(pCookieManager, "Failed to get webkit instance.");
- _WebPresenter presenter;
- presenter.InitAsyncProcess();
+ std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this));
+ SysTryReturn(NID_WEB_CTRL, pPresenter.get(), false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- ewk_cookie_manager_async_accept_policy_get(pCookieManager, OnCookiesPolicyGot, &presenter);
+ ewk_cookie_manager_async_accept_policy_get(pCookieManager, OnCookiesPolicyGot, pPresenter.get());
bool result = false;
- presenter.WaitAsyncProcess(result);
+ pPresenter->WaitAsyncProcess(result);
return result;
}
evas_object_smart_callback_add(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest, this);
evas_object_smart_callback_add(pWinObject, "focus,in", OnWindowObjectFocusGained, this);
+ evas_object_smart_callback_add(pWinObject, "focus,out", OnWindowObjectFocusLost, this);
evas_object_smart_callback_add(pWebNativeNode, "inputmethod,changed", OnWebKeypadStateChanged, this);
evas_object_smart_callback_add(pWebNativeNode, "editorclient,ime,opened", OnWebKeypadOpened, this);
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);
evas_object_smart_callback_add(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered, this);
evas_object_smart_callback_add(pWebNativeNode, "icon,received", OnFaviconReceived, this);
- evas_object_smart_callback_add(pWebNativeNode, "text,selected", OnWebPageBlockSelected, this);
- evas_object_smart_callback_add(pWebNativeNode, "frame,rendered", OnWebPageBlockSelectedByOrientation, this);
+ evas_object_smart_callback_add(pWebNativeNode, "magnifier,hide", OnWebPageBlockSelected, this);
evas_object_smart_callback_add(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered, this);
evas_object_smart_callback_add(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited, this);
- ewk_view_open_panel_callback_set(pWebNativeNode, OnSelectUploadFile, const_cast< _WebImpl* >(this));
+ evas_object_smart_callback_add(pWebNativeNode, "keyevent,down,not,handled", OnFocusDownRequested, this);
+ evas_object_smart_callback_add(pWebNativeNode, "keyevent,up,not,handled", OnFocusUpRequested, this);
+
Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
SysAssertf(pContext, "Failed to get webkit instance.");
ewk_context_did_start_download_callback_set(pContext, OnDidStartDownloadCallback, const_cast< _WebImpl* >(this));
ewk_view_exceeded_local_file_system_quota_callback_set(pWebNativeNode, OnLocalFileSystemQuotaExceeded, const_cast< _WebImpl* >(this));
evas_object_event_callback_add(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained, this);
+ evas_object_event_callback_add(pWebNativeNode, EVAS_CALLBACK_FOCUS_OUT, OnWebNativeNodeFocusLost, this);
}
}
evas_object_smart_callback_del(pWebNativeNode, "load,stop", OnLoadingCanceled);
evas_object_smart_callback_del(pWebNativeNode, "load,error", OnLoadingErrorOccurred);
evas_object_smart_callback_del(pWebNativeNode, "title,changed", OnPageTitleReceived);
+ evas_object_smart_callback_del(pWebNativeNode, "load,committed", OnLoadingCommitted);
evas_object_smart_callback_del(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest);
evas_object_smart_callback_del_full(pWinObject, "focus,in", OnWindowObjectFocusGained, this);
+ evas_object_smart_callback_del_full(pWinObject, "focus,out", OnWindowObjectFocusLost, this);
evas_object_smart_callback_del(pWebNativeNode, "inputmethod,changed", OnWebKeypadStateChanged);
evas_object_smart_callback_del(pWebNativeNode, "editorclient,ime,opened", OnWebKeypadOpened);
evas_object_smart_callback_del(pWebNativeNode, "geolocation,permission,request", OnGeolocationPermissionRequested);
- ewk_view_javascript_alert_callback_set(null, null, null);
- ewk_view_javascript_prompt_callback_set(null, null, null);
- ewk_view_javascript_confirm_callback_set(null, null, null);
+ 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);
evas_object_smart_callback_del(pWebNativeNode, "touchmove,handled", OnWebPreventDefaultTriggered);
evas_object_smart_callback_del(pWebNativeNode, "icon,received", OnFaviconReceived);
- evas_object_smart_callback_del(pWebNativeNode, "text,selected", OnWebPageBlockSelected);
- evas_object_smart_callback_del(pWebNativeNode, "frame,rendered", OnWebPageBlockSelectedByOrientation);
+ evas_object_smart_callback_del(pWebNativeNode, "magnifier,hide", OnWebPageBlockSelected);
evas_object_smart_callback_del(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered);
evas_object_smart_callback_del(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited);
- ewk_view_open_panel_callback_set(null, null, null);
+ evas_object_smart_callback_del(pWebNativeNode, "keyevent,down,not,handled", OnFocusDownRequested);
+ evas_object_smart_callback_del(pWebNativeNode, "keyevent,up,not,handled", OnFocusUpRequested);
+
Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
SysAssertf(pContext, "Failed to get webkit instance.");
ewk_context_vibration_client_callbacks_set(pContext, null, null, null);
ewk_view_exceeded_local_file_system_quota_callback_set(pWebNativeNode, null, null);
evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained);
+ evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_OUT, OnWebNativeNodeFocusLost);
}
}
result
_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
{
- Evas_Object* pView = __pWebCore->GetWebNativeNode();
- Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pView);
- if (pSmartData && pSmartData->api)
+ Evas_Object* pWebview = __pWebCore->GetWebNativeNode();
+ if (!pWebview)
{
- Point absPoint( _CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(startPoint)));
+ return E_SUCCESS;
+ }
- Eina_Bool ret = pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
- if (ret)
- {
- pSmartData->api->text_selection_up(pSmartData, absPoint.x, absPoint.y);
+ Ewk_View_Smart_Data* pSmartData = reinterpret_cast< Ewk_View_Smart_Data* >(evas_object_smart_data_get(pWebview));
+ SysAssertf(pSmartData && pSmartData->api, "Failed to get webkit instance.");
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(startPoint)));
- Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(pView, absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL);
- SysTryReturnResult(NID_WEB_CTRL, pEwkHitTest, E_SYSTEM, "Failed to get hit test.");
+ Eina_Bool ret = pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
+ if (ret)
+ {
+ pSmartData->api->text_selection_up(pSmartData, absPoint.x, absPoint.y);
- String tagName(ewk_hit_test_tag_name_get(pEwkHitTest));
+ Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(pWebview, absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL);
+ SysTryReturnResult(NID_WEB_CTRL, pEwkHitTest, E_SYSTEM, "Failed to get hit test.");
- if (tagName.Equals(L"INPUT", false) || tagName.Equals(L"TEXTAREA", false))
- {
- ewk_view_command_execute(pView, "SelectWord", 0);
- }
- else
- {
- Eina_Hash* pAttrHash = ewk_hit_test_attribute_hash_get(pEwkHitTest);
- char* pValue = reinterpret_cast< char* >(eina_hash_find(pAttrHash, "contenteditable"));
- if(pValue)
- {
- ewk_view_command_execute(pView, "SelectWord", 0);
- }
- }
+ String tagName(ewk_hit_test_tag_name_get(pEwkHitTest));
+
+ Eina_Hash* pAttrHash = ewk_hit_test_attribute_hash_get(pEwkHitTest);
+ char* pValue = reinterpret_cast< char* >(eina_hash_find(pAttrHash, "contenteditable"));
+ if (tagName.Equals(L"INPUT", false) || tagName.Equals(L"TEXTAREA", false) || pValue)
+ {
+ ewk_view_command_execute(pWebview, "SelectWord", 0);
+ evas_object_smart_callback_call(pWebview, "magnifier,hide", NULL);
}
}
SysTryReturnResult(NID_WEB_CTRL, GetTextFromBlock().GetLength() > 0, E_INVALID_ARG, "Failed to set text selection up.");
- evas_object_smart_callback_call(pView, "text,selected", NULL);
-
return E_SUCCESS;
}
result
-_WebImpl::AddCustomHeader(const String& name, const String& value)
+_WebImpl::AddHttpHeaderField(const String& name, const String& value)
{
SysTryReturnResult(NID_WEB_CTRL, name.GetLength() > 0, E_INVALID_ARG, "Invalid argument(s) is used. name key is missing.");
result
-_WebImpl::RemoveCustomHeader(const String& name)
+_WebImpl::RemoveHttpHeaderField(const String& name)
{
SysTryReturnResult(NID_WEB_CTRL, name.GetLength() > 0, E_INVALID_ARG, "Invalid argument(s) is used. name key is missing.");
}
-void
-_WebImpl::SetOrientationChanged(bool arg)
-{
- __isOrientationChanged = arg;
-}
-
-
-bool
-_WebImpl::IsOrientationChanged(void) const
-{
- return __isOrientationChanged;
-}
-
-
result
_WebImpl::SetFullScreenKeypad(void)
{
}
+bool
+_WebImpl::IsWinFocusLost(void) const
+{
+ return __isWinFocusLost;
+}
+
+
+void
+_WebImpl::SetWinFocusLost(bool isWinFocusLost)
+{
+ __isWinFocusLost = isWinFocusLost;
+}
+
+
Rectangle
_WebImpl::GetPreviousKeypadBounds(void) const
{
int modalResult = 0;
- __pAuthPopup->SetOwner(&GetPublic());
-
r = __pAuthPopup->ShowAndWait(modalResult);
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
CATCH:
- __pAuthPopup.reset();
+ if (__pAuthPopup)
+ {
+ __pAuthPopup.reset();
+ }
return r;
}
int modalResult = 0;
- __pCertConfirmPopup->SetOwner(&GetPublic());
-
r = __pCertConfirmPopup->ShowAndWait(modalResult);
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- if (userConfirmMode == CERTIFICATE_POPUP_MODE_USER_CONFIRM)
+ if (__pCertConfirmPopup.get() && userConfirmMode == CERTIFICATE_POPUP_MODE_USER_CONFIRM)
{
__isCertificateConfirmed = __pCertConfirmPopup->GetConfirmResult();
}
CATCH:
- __pCertConfirmPopup.reset();
+ if (__pCertConfirmPopup.get())
+ {
+ __pCertConfirmPopup.reset();
+ }
return r;
}
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);
- __pPromptPopup->SetOwner(&GetPublic());
-
r = __pPromptPopup->ShowPopup();
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
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));
- pUserConfirmPopup->SetOwner(&GetPublic());
-
int modalResult = 0;
switch(userConfirmMode)
{
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;
}
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));
- pUserConfirmPopup->SetOwner(&GetPublic());
-
switch(userConfirmMode)
{
case USER_CONFIRM_USERMEDIA:
- {
- __pUserMediaConfirmPopup.reset();
+ {
+ __pUserMediaConfirmPopup.reset();
__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:
r = __pGeolocationConfirmPopup->ShowPopup();
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pGeolocationConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
- __pGeolocationConfirmPopup.release();
break;
}
case USER_CONFIRM_NOTIFICATION:
r = __pNotificationConfirmPopup->ShowPopup();
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pNotificationConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
- __pNotificationConfirmPopup.release();
break;
}
case USER_SCRIPT_ALERT:
r = __pScriptAlertConfirmPopup->ShowPopup();
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pScriptAlertConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
- __pScriptAlertConfirmPopup.release();
+ break;
+ }
+ case USER_SCRIPT_CONFIRM:
+ {
+ __pScriptConfirmPopup.reset();
+
+ __pScriptConfirmPopup = std::move(pUserConfirmPopup);
+
+ r = __pScriptConfirmPopup->ShowPopup();
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pScriptConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ 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:
}
-_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::OnFocusLost(const _ControlImpl& source)
{
+ Evas_Object* pWebview = __pWebCore->GetWebNativeNode();
+ if (!pWebview)
+ {
+ return false;
+ }
+
if(IsKeypadVisible() == true)
{
SetKeypadOpened(true);
-
- SetKeypadVisibleState(false);
}
- evas_object_focus_set(__pWebCore->GetWebNativeNode(), EINA_FALSE);
-
return false;
}
{
result r = E_SUCCESS;
- r = __pWebCore->InitializeWebNativeNode();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ if (IsVisible() == true)
+ {
+ _WebManager* pWebManager = _WebManager::GetInstance();
+ pWebManager->SetActiveWeb(this);
+ }
- r = InitializeSetting();
+ r = _ContainerImpl::OnPreAttachedToMainTree();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- r = _ContainerImpl::OnPreAttachedToMainTree();
+ if (!HasValidNativeNode())
+ {
+ 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));
+
+ _SettingInfoImpl::AddSettingEventListener(*this);
+
+ _WebManager* pWebManager = _WebManager::GetInstance();
+ pWebManager->AddWeb(reinterpret_cast< int >(this));
+ }
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebImpl::OnDetachingFromMainTree(void)
+{
+ result r = E_SUCCESS;
+
+ _WebManager* pWebManager = _WebManager::GetInstance();
+ pWebManager->RemoveActiveWeb(this);
+
+ r = _ContainerImpl::OnDetachingFromMainTree();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return E_SUCCESS;
void
+_WebImpl::OnSettingChanged(String& key)
+{
+ Evas_Object* pWebview = __pWebCore->GetWebNativeNode();
+ if (!pWebview)
+ {
+ return;
+ }
+
+ if (key == L"http://tizen.org/setting/font.type")
+ {
+ ewk_view_use_settings_font(pWebview);
+ }
+}
+
+
+void
+_WebImpl::OnChangeLayout(_ControlRotation rotation)
+{
+ Evas_Object* pWebview = __pWebCore->GetWebNativeNode();
+ if (!pWebview)
+ {
+ return;
+ }
+
+ int degree = 0;
+
+ switch (rotation)
+ {
+ case _CONTROL_ROTATION_0:
+ degree = 0;
+ break;
+ case _CONTROL_ROTATION_90:
+ degree = 90;
+ break;
+ case _CONTROL_ROTATION_180:
+ degree = 180;
+ break;
+ case _CONTROL_ROTATION_270:
+ degree = -90;
+ break;
+ default:
+ SysAssert(false);
+ }
+ ewk_view_orientation_send(pWebview, degree);
+}
+
+
+void
_WebImpl::OnChangeLayout(_ControlOrientation orientation)
{
_ContainerImpl::OnChangeLayout(orientation);
- __isOrientationChanged = true;
-
if (__pColorPicker.get())
{
__pColorPicker->ChangeLayout(orientation);
pWebNotification = static_cast< _WebNotification* >(pEnum->GetCurrent());
pWebNotification->OnChangeLayout();
}
+
+ if (IsKeypadVisible())
+ {
+ _ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetInverseTransformer();
+ SysAssertf(pXformer, "Failed to get CoordinateTransformer");
+
+ _FormImpl* pFormImpl = GetParentFormImpl(dynamic_cast< _ControlImpl* >(this));
+ pFormImpl->DeflateClientRectHeight(pXformer->TransformVertical(GetPreviousKeypadBounds().height));
+ }
}
void
_WebImpl::OnAncestorVisibleStateChanged(const _Control& control)
{
+ Evas_Object* pWebview = __pWebCore->GetWebNativeNode();
+ if (!pWebview)
+ {
+ return;
+ }
+
+ _WebManager* pWebManager = _WebManager::GetInstance();
if (IsVisible() == true)
{
- ewk_view_page_visibility_state_set(__pWebCore->GetWebNativeNode(), EWK_PAGE_VISIBILITY_STATE_VISIBLE, false);
+ pWebManager->SetActiveWeb(this);
+ ewk_view_page_visibility_state_set(pWebview, EWK_PAGE_VISIBILITY_STATE_VISIBLE, false);
}
else
{
- ewk_view_page_visibility_state_set(__pWebCore->GetWebNativeNode(), EWK_PAGE_VISIBILITY_STATE_HIDDEN, false);
+ pWebManager->RemoveActiveWeb(this);
+ ewk_view_page_visibility_state_set(pWebview, EWK_PAGE_VISIBILITY_STATE_HIDDEN, false);
}
}
case ID_USER_SCRIPT_ALERT_CLOSE:
__pScriptAlertConfirmPopup.reset();
break;
+ 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;
default:
break;
}
+
+ Resume();
}
{
__pColorPicker.reset();
+ Resume();
+
return EINA_TRUE;
}
r = __pColorPicker->ShowPopup();
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- color = __pColorPicker->GetColor();
-
- return E_SUCCESS;
+ if (__pColorPicker)
+ {
+ color = __pColorPicker->GetColor();
+ }
CATCH:
- __pColorPicker.reset();
+ if (__pColorPicker)
+ {
+ __pColorPicker.reset();
+ Resume();
+ }
return r;
}
r = __pDatePicker->ShowPopup();
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- dateStr = __pDatePicker->GetDate();
+ if (__pDatePicker)
+ {
+ dateStr = __pDatePicker->GetDate();
+ }
CATCH:
- __pDatePicker.reset();
+ if (__pDatePicker)
+ {
+ __pDatePicker.reset();
+ Resume();
+ }
return r;
}
}
-void
-_WebImpl::OnDownloadCompleted(RequestId reqId, const String &path)
-{
- _ContentManagerImpl::ScanFile(path);
-}
-
-
}}} // Tizen::Web::Controls