Apply focus ui, fix for issue
[framework/osp/web.git] / src / controls / FWebCtrl_WebImpl.cpp
index 525baeb..637f8ab 100755 (executable)
@@ -859,6 +859,28 @@ OnFullScreenExited(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
 
 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;
@@ -3545,6 +3567,9 @@ _WebImpl::SetEventListenerCallback(void) const
                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));
@@ -3628,6 +3653,9 @@ _WebImpl::RemoveEventListenerCallback(void) const
                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);