#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>
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;
-}
-
-
-Eina_Bool
AddHttpAttributeData(const Eina_Hash* pHash, const void* pKey, void* pValue, void* pUserData)
{
result r = E_SUCCESS;
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);
+}
+
+
+void
OnVibrationRequested(uint64_t duration, void* pUserData)
{
result r = E_SUCCESS;
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()));
{
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"))
{
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;
- policy = pLoadingListener->OnWebDataReceived(mime, httpHeader);
- pImpl->SetPolicyDecision(policy);
+ Eina_Iterator* iterator = eina_hash_iterator_tuple_new(ewk_policy_decision_response_headers_get(pPolicy));
+ if (iterator)
+ {
+ Eina_Hash_Tuple *tuple = null;
+
+ 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, , 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);
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)
{
- _SelectBox* pSelectBox = new (std::nothrow) _SelectBox;
- SysTryReturnVoidResult(NID_WEB_CTRL, pSelectBox, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ String operationId(L"http://tizen.org/appcontrol/operation/download");
- r = pSelectBox->Construct(false, L"Select application", 1, null, url);
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pSelectBox->AddListItem(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_DOWNLOAD"), _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
- r = pSelectBox->ShowPopup();
+ r = _AppControlImpl::FindAndStart(operationId, &url, null, null, null, null);
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
}
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);
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);
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));
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();
if (pFormImpl)
{
pFormImpl->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
-
- if (pFormImpl->HasFooter())
- {
- pFormImpl->GetCore().SetKeypadShowState(true);
- pFormImpl->Draw();
- }
}
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()));
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->IsKeypadOpened() == true && pImpl->IsVisible() == true && pImpl->IsFocused() == true)
+ if (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);
+ if (pImpl->IsWinFocusLost() == true)
+ {
+ if (pImpl->IsKeypadOpened() == true)
+ {
+ evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
+ }
+
+ Ewk_Settings* pSettings = ewk_view_settings_get(pWebCore->GetWebNativeNode());
+ SysAssertf(pSettings, "Failed to get settings instance.");
+
+ if (ewk_settings_clear_text_selection_automatically_get(pSettings) == EINA_FALSE)
+ {
+ ewk_settings_clear_text_selection_automatically_set(pSettings, EINA_TRUE);
- pImpl->SetKeypadVisibleState(true);
+ evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
+ }
+ }
}
+
+ pImpl->SetWinFocusLost(false);
}
{
pImpl->SetKeypadOpened(false);
}
+}
+
+
+void
+OnWebNativeNodeFocusLost(void* pUserData, Evas* pCanvas, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+ SysAssertf(pImpl, "Failed to request");
+
+ if (pImpl->IsWinFocusLost() == true)
+ {
+ _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+ SysAssertf(pWebCore, "Failed to get Web core object");
+
+ Ewk_Settings* pSettings = ewk_view_settings_get(pWebCore->GetWebNativeNode());
+ SysAssertf(pSettings, "Failed to get settings instance.");
+
+ ewk_settings_clear_text_selection_automatically_set(pSettings, EINA_FALSE);
+ }
}
, __isFooterVisible(false)
, __isKeypadVisible(false)
, __isKeypadOpened(false)
+ , __isWinFocusLost(false)
, __isLoadingErrorOccurred(false)
, __isRedirectRequested(false)
, __isCertificateRequested(false)
_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:
RemoveEventListenerCallback();
ClearCertificateDb();
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[]> 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, "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(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);
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, "magnifier,hide", OnWebPageBlockSelected, this);
evas_object_smart_callback_add(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered, this);
evas_object_smart_callback_add(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited, 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, "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, "magnifier,hide", OnWebPageBlockSelected);
evas_object_smart_callback_del(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered);
evas_object_smart_callback_del(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited);
+ 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;
+ }
- 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);
+ SetFocused();
- 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;
}
}
+bool
+_WebImpl::IsWinFocusLost(void) const
+{
+ return __isWinFocusLost;
+}
+
+
+void
+_WebImpl::SetWinFocusLost(bool isWinFocusLost)
+{
+ __isWinFocusLost = isWinFocusLost;
+}
+
+
Rectangle
_WebImpl::GetPreviousKeypadBounds(void) const
{
{
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:
r = __pScriptConfirmPopup->ShowPopup();
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, __pScriptConfirmPopup.reset(), r, "[%s] Propagating.", GetErrorMessage(r));
- __pScriptConfirmPopup.release();
-
break;
}
default:
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);
-
return false;
}
bool
_WebImpl::OnFocusLost(const _ControlImpl& source)
{
+ Evas_Object* pWebview = __pWebCore->GetWebNativeNode();
+ if (!pWebview)
+ {
+ return false;
+ }
+
if(IsKeypadVisible() == true)
{
SetKeypadOpened(true);
-
- 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;
}
}
-void
-_WebImpl::OnDownloadCompleted(RequestId reqId, const String &path)
-{
- _ContentManagerImpl::ScanFile(path);
-}
-
-
}}} // Tizen::Web::Controls