#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"
_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;
-
- 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);
- }
-
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());
}
void
+OnFullScreenEntered(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ SysAssertf(pImpl, "Failed to request");
+
+ SysLog(NID_WEB_CTRL, "Enter.");
+}
+
+
+void
+OnFullScreenExited(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ SysAssertf(pImpl, "Failed to request");
+
+ SysLog(NID_WEB_CTRL, "Exit.");
+}
+
+
+void
OnVibrationRequested(uint64_t duration, void* pUserData)
{
result r = E_SUCCESS;
result r = E_SUCCESS;
- _WebEventType eventType = WEB_EVENT_REQUEST_UNKNOWN;
-
- if (uriScheme == L"rtsp")
- {
- eventType = WEB_EVENT_REQUEST_RTSP;
- }
- else if (uriScheme == L"mailto")
- {
- eventType = WEB_EVENT_REQUEST_EMAIL;
- }
- else if (uriScheme == L"tel")
+ if (uriScheme == L"tel")
{
- eventType = WEB_EVENT_REQUEST_TEL;
+ String operationId(L"http://tizen.org/appcontrol/operation/dial");
+ r = _AppControlImpl::FindAndStart(operationId, &url, null, null, null, null);
}
- else if (uriScheme == L"sms" || uriScheme == L"smsto" )
+ else if (uriScheme == L"mailto" || uriScheme == L"sms" || uriScheme == L"smsto" || uriScheme == L"mms" || uriScheme == L"mmsto" )
{
- eventType = WEB_EVENT_REQUEST_SMS;
+ String operationId(L"http://tizen.org/appcontrol/operation/compose");
+ r = _AppControlImpl::FindAndStart(operationId, &url, null, null, null, null);
}
- else if (uriScheme == L"mms" || uriScheme == L"mmsto" )
+ else
{
- eventType = WEB_EVENT_REQUEST_MMS;
+ 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);
}
-
- std::unique_ptr<_WebEventArg> pEventArg(new _WebEventArg(eventType, url));
- SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pEventArg.release();
return;
}
String url(ewk_policy_decision_url_get(pPolicy));
-
if (pLoadingListener && ewk_frame_is_main_frame(ewk_policy_decision_frame_get(pPolicy)))
{
const Eina_Hash* pHeader = ewk_policy_decision_response_headers_get(pPolicy);
else
{
- SysLog(NID_WEB_CTRL, "Launch native app to handle the mime");
-
ewk_policy_decision_ignore(pPolicy);
- AppControl* pAppControl = null;
- _SelectBox selectBox;
- int appCount = 0;
- int selectedIndex = 0;
+ String operationId(L"http://tizen.org/appcontrol/operation/view");
- std::unique_ptr<IList, AllElementsDeleter> pList(_AppManagerImpl::FindAppControlsN(NULL, NULL, &mime, NULL));
-
- if (pList.get())
- {
- appCount = pList->GetCount();
- }
-
- r = selectBox.Construct(false, L"", appCount+1); //+1 for Downloader
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- selectBox.AddListItem(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_DOWNLOAD"), _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
- for (int i = 0; i < appCount; i++)
- {
- pAppControl = dynamic_cast< AppControl* >(pList->GetAt(i));
- SysTryReturnVoidResult(NID_WEB_CTRL, pAppControl, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- String text = pAppControl->GetAppName();
- SysLog(NID_WEB_CTRL, "AppName : %S", text.GetPointer());
-
- selectBox.AddListItem(text, _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
- }
- r = selectBox.ShowAndWait(selectedIndex);
- 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));
- }
- else if (selectedIndex != -1) // -1 for cancel
+ 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)
{
- String path("path");
- String pathVal(pUrl);
+ _SelectBox* pSelectBox = new (std::nothrow) _SelectBox;
+ SysTryReturnVoidResult(NID_WEB_CTRL, pSelectBox, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- HashMap dataList;
- r = dataList.Construct();
+ r = pSelectBox->Construct(false, L"Select application", 1, null, url);
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- r = dataList.Add(path, pathVal);
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pAppControl = dynamic_cast< AppControl* >(pList->GetAt(selectedIndex));
- SysTryReturnVoidResult(NID_WEB_CTRL, pAppControl, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- _AppControlImpl* pAcImpl = _AppControlImpl::GetInstance(*pAppControl);
- SysTryReturnVoidResult(NID_WEB_CTRL, pAcImpl, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- r = pAcImpl->Start(null, null, &dataList, null);
+ 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));
}
void
-OnLoadingCommitted(void* pUserData, Evas_Object* pView, void* pEventInfo)
-{
- evas_object_focus_set(pView, EINA_FALSE);
-}
-
-
-void
OnFaviconReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
{
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
}
-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);
-}
-
-
Eina_Bool
OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData)
{
Eina_Rectangle* pEinaRect = reinterpret_cast< Eina_Rectangle* >(pEventInfo);
SysAssertf(pImpl && pEinaRect, "Failed to request");
+ if (pImpl->IsVisible() == false)
+ {
+ evas_object_focus_set(pView, EINA_FALSE);
+ }
+
if (pImpl->GetSetting().GetInputStyle() == INPUT_STYLE_OVERLAY)
{
_ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetInverseTransformer();
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();
}
}
_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
SysAssertf(pImpl, "Failed to request");
- if (pImpl->IsKeypadOpened() == true && pImpl->IsVisible() == true && pImpl->IsFocused())
+ if (pImpl->IsKeypadOpened() == true && pImpl->IsVisible() == true && pImpl->IsFocused() == true)
{
_Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
SysAssertf(pWebCore, "Failed to get Web core object");
evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
- }
- pImpl->SetKeypadOpened(false);
+ pImpl->SetKeypadVisibleState(true);
+ }
}
if (pImpl->IsKeypadOpened() == true)
{
- pImpl->SetKeypadOpened(false);
-
- pImpl->SetFocused();
+ pImpl->SetKeypadOpened(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);
}
, __isRedirectRequested(false)
, __isCertificateRequested(false)
, __isCertificateConfirmed(false)
- , __isOrientationChanged(false)
, __isFormDataVisible(false)
, __keypadBounds(0, 0, 0, 0)
, __pWebCore(null)
, __pWebEvent(null)
, __pAuthChallenge(null)
, __pAuthPopup(null)
- , __pUserConfirmPopup(null)
+ , __pUserMediaConfirmPopup(null)
+ , __pContentHandlerConfirmPopup(null)
+ , __pProtocolHandlerConfirmPopup(null)
+ , __pGeolocationConfirmPopup(null)
+ , __pNotificationConfirmPopup(null)
+ , __pScriptAlertConfirmPopup(null)
+ , __pScriptConfirmPopup(null)
+ , __pAppCacheConfirmPopup(null)
+ , __pDbQuotaConfirmPopup(null)
+ , __pLocalFsQuotaConfirmPopup(null)
+ , __pIndexedDbQuotaConfirmPopup(null)
, __pPromptPopup(null)
, __pCertConfirmPopup(null)
, __pSelectBox(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);
-
- 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));
__pSelectBox = std::move(pSelectBox);
- __pSelectBox->SetOwner(&GetPublic());
-
return __pSelectBox->ShowPopup();
}
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();
-}
+ pPresenter->WaitAsyncProcess(*pResult.get());
-bool
-_WebImpl::IsPresenterAlived(_WebPresenter* pPresenter) const
-{
- return __callbackList.Contains(*pPresenter);
+ return pResult.release();
}
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, "load,stop", OnLoadingCanceled, this);
evas_object_smart_callback_add(pWebNativeNode, "load,error", OnLoadingErrorOccurred, this);
evas_object_smart_callback_add(pWebNativeNode, "title,changed", OnPageTitleReceived, this);
- evas_object_smart_callback_add(pWebNativeNode, "load,committed", OnLoadingCommitted, this);
evas_object_smart_callback_add(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest, 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, "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));
Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
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, "fullscreen,enterfullscreen", OnFullScreenEntered);
+ evas_object_smart_callback_del(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited);
ewk_view_open_panel_callback_set(null, null, null);
Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
}
+result
+_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.");
+
+ std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(name));
+ SysTryReturn(NID_WEB_CTRL, pName.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ std::unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(value));
+
+ ewk_view_custom_header_add(__pWebCore->GetWebNativeNode(), pName.get(), pValue.get());
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebImpl::RemoveHttpHeaderField(const String& name)
+{
+ SysTryReturnResult(NID_WEB_CTRL, name.GetLength() > 0, E_INVALID_ARG, "Invalid argument(s) is used. name key is missing.");
+
+ std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(name));
+ SysTryReturn(NID_WEB_CTRL, pName.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ ewk_view_custom_header_remove(__pWebCore->GetWebNativeNode(), pName.get());
+
+ return E_SUCCESS;
+}
+
+
void
_WebImpl::SetLoadingErrorOccurred(bool arg)
{
}
-void
-_WebImpl::SetOrientationChanged(bool arg)
-{
- __isOrientationChanged = arg;
-}
-
-
-bool
-_WebImpl::IsOrientationChanged(void) const
-{
- return __isOrientationChanged;
-}
-
-
-result
-_WebImpl::LaunchAppControl(const IEventArg& arg)
-{
- result r = E_SUCCESS;
-
- IEventArg* pArg = const_cast< IEventArg* >(&arg);
- _WebEventArg* pWebEventArg = dynamic_cast< _WebEventArg* >(pArg);
- SysTryReturnResult(NID_WEB_CTRL, pWebEventArg, E_INVALID_ARG, "Type casting failed. argument must be IEventArg type.");
-
- String operationId(L"");
- String uriPattern(pWebEventArg->GetEventMessage());
- SysLog(NID_WEB_CTRL, "The current value of web event type is %d", pWebEventArg->GetEventType());
-
- switch (pWebEventArg->GetEventType())
- {
- case WEB_EVENT_REQUEST_RTSP:
- {
- String ext;
- String mimeType;
- int uriLength = uriPattern.GetLength();
- int index;
-
- operationId = L"http://tizen.org/appcontrol/operation/view";
-
- r = uriPattern.LastIndexOf(L".", uriLength - 1, index);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = uriPattern.SubString(index + 1, ext);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = _AppControlManager::GetMimeFromExt(ext, mimeType);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = _AppControlImpl::FindAndStart(operationId, &uriPattern, &mimeType, null, null, null);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return r;
- }
- case WEB_EVENT_REQUEST_TEL:
- {
- operationId = L"http://tizen.org/appcontrol/operation/dial";
- break;
- }
- case WEB_EVENT_REQUEST_EMAIL:
- //fall through
- case WEB_EVENT_REQUEST_SMS:
- //fall through
- case WEB_EVENT_REQUEST_MMS:
- {
- operationId = L"http://tizen.org/appcontrol/operation/compose";
- break;
- }
- case WEB_EVENT_REQUEST_UNKNOWN:
- {
- operationId = L"http://tizen.org/appcontrol/operation/view";
- break;
- }
- default:
- SysAssert(false);
- break;
- }
-
- r = _AppControlImpl::FindAndStart(operationId, &uriPattern, null, null, null, null);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return r;
-}
-
-
result
_WebImpl::SetFullScreenKeypad(void)
{
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;
}
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);
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 = std::move(pUserConfirmPopup);
-
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 = std::move(pUserConfirmPopup);
- return r;
+ 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 = 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 = 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 = 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 = 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 = 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:
+ break;
+ }
+CATCH:
+ return 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, false, msg);
+ r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, this, false, msg);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- __pUserConfirmPopup = std::move(pUserConfirmPopup);
+ switch(userConfirmMode)
+ {
+ case USER_CONFIRM_USERMEDIA:
+ {
+ __pUserMediaConfirmPopup.reset();
- __pUserConfirmPopup->SetOwner(&GetPublic());
+ __pUserMediaConfirmPopup = std::move(pUserConfirmPopup);
- r = __pUserConfirmPopup->ShowPopup();
- SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = __pUserMediaConfirmPopup->ShowPopup();
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pUserMediaConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
- __pUserConfirmPopup.release();
+ __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);
+
+ r = __pScriptAlertConfirmPopup->ShowPopup();
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pScriptAlertConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pScriptAlertConfirmPopup.release();
+ break;
+ }
+ default:
+ break;
+ }
return E_SUCCESS;
CATCH:
- __pUserConfirmPopup.reset();
-
return r;
}
-_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::OnChangeLayout(_ControlRotation rotation)
+{
+ 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(__pWebCore->GetWebNativeNode(), degree);
+}
+
+
void
_WebImpl::OnChangeLayout(_ControlOrientation orientation)
{
_ContainerImpl::OnChangeLayout(orientation);
- __isOrientationChanged = true;
-
if (__pColorPicker.get())
{
__pColorPicker->ChangeLayout(orientation);
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_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;
+ case ID_USER_SCRIPT_CONFIRM_CLOSE:
+ __pScriptConfirmPopup.reset();
break;
default:
break;
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();
+ }
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();
+ }
return r;
}