_WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
String msg(pMessage);
- r = pImpl->ShowUserConfirmPopup(USER_SCRIPT_CONFIRM, pView, msg);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+ 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;
}
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);
}
if (pImpl->GetLoadingListener() && 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())
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));
}
-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)
{
if (pImpl->IsKeypadOpened() == true)
{
- pImpl->SetKeypadOpened(false);
+ pImpl->SetKeypadOpened(false);
}
}
_WebImpl::~_WebImpl()
{
+ _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
+ pManagerImpl->SetDownloadListener(null);
+
+ _WebManager* pWebManager = _WebManager::GetInstance();
+ pWebManager->RemoveWeb(reinterpret_cast< int >(this));
+
+ RemoveEventListenerCallback();
+
ClearCertificateDb();
}
__pSelectBox.reset();
+ Resume();
+
return E_SUCCESS;
}
std::unique_ptr<char[]> pText(_StringConverter::CopyToCharArrayN(text));
SysTryReturn(NID_WEB_CTRL, pText.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ 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);
+
switch (type)
{
case SEARCH_SYNC:
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);
SysAssertf(pContext, "Failed to get webkit instance.");
ewk_context_did_start_download_callback_set(pContext, OnDidStartDownloadCallback, const_cast< _WebImpl* >(this));
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);
evas_object_smart_callback_del(pWebNativeNode, "policy,response,decide", OnWebDataReceived);
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);
SysAssertf(pContext, "Failed to get webkit instance.");
ewk_context_vibration_client_callbacks_set(pContext, null, null, null);
{
Point absPoint( _CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(startPoint)));
+ 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);
+
Eina_Bool ret = pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
if (ret)
{
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, this);
+ r = pCertConfirmPopup->Construct(userConfirmMode, pPolicy);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pCertConfirmPopup = std::move(pCertConfirmPopup);
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;
}
switch(userConfirmMode)
{
case USER_CONFIRM_USERMEDIA:
- {
+ {
__pUserMediaConfirmPopup.reset();
__pUserMediaConfirmPopup = std::move(pUserConfirmPopup);
__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));
+
+ __pScriptConfirmPopup.release();
+
+ break;
+ }
default:
break;
}
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;
}
pWebManager->SetActiveWeb(this);
}
- r = __pWebCore->InitializeWebNativeNode();
+ r = _ContainerImpl::OnPreAttachedToMainTree();
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());
+ if (!HasValidNativeNode())
+ {
+ r = __pWebCore->InitializeWebNativeNode();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- r = InitializeSetting();
- 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 = _ContainerImpl::OnPreAttachedToMainTree();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = InitializeSetting();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- _WebManager* pWebManager = _WebManager::GetInstance();
- pWebManager->AddWeb(reinterpret_cast< int >(this));
+ _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);
+ result r = E_SUCCESS;
- _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance();
- pManagerImpl->SetDownloadListener(null);
+ _WebManager* pWebManager = _WebManager::GetInstance();
+ pWebManager->RemoveActiveWeb(this);
- RemoveEventListenerCallback();
+ r = _ContainerImpl::OnDetachingFromMainTree();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return E_SUCCESS;
}
_WebImpl::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
{
_ContainerImpl::OnUserEventReceivedN(requestId, pArgs);
-
+
switch (requestId)
{
case ID_CERTIFICATE_CONFIRM_POPUP_CLOSE:
default:
break;
}
+
+ Resume();
}
{
__pColorPicker.reset();
+ Resume();
+
return EINA_TRUE;
}
if (__pColorPicker)
{
__pColorPicker.reset();
+ Resume();
}
return r;
if (__pDatePicker)
{
__pDatePicker.reset();
+ Resume();
}
return r;