From: yh106.jung Date: Mon, 16 Mar 2015 04:59:17 +0000 (+0900) Subject: Enable ewk_view_feed_touch_event X-Git-Tag: submit/tizen/20201118.160233~1063 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=258a9dda9fa3d8fdb1c4861d82ce30782bfc75a7;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Enable ewk_view_feed_touch_event Make ewk_view_feed_touch_event is available. Currently use tizen webview interface, but tizen webview interface will be removed later. Change-Id: I18d39d45280808a253ad7ed139cb777354b25221 Signed-off-by: yh106.jung --- diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 59992d4..69364ca 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -51,7 +51,6 @@ #include "devtools_delegate_efl.h" #include "tizen_webview/public/tw_hit_test.h" -#include "tizen_webview/public/tw_touch_point.h" #include "tizen_webview/public/tw_web_context.h" #include "tizen_webview/public/tw_webview.h" #include "tizen_webview/public/tw_webview_delegate.h" @@ -744,6 +743,27 @@ void EWebView::InvokePolicyNavigationCallback(RenderViewHost* rvh, *handled = policy_decision->GetImpl()->GetNavigationPolicyHandler()->GetDecision() == NavigationPolicyHandlerEfl::Handled; } +void EWebView::HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers) +{ + const Eina_List* l; + void* data; + EINA_LIST_FOREACH(points, l, data) { + const Ewk_Touch_Point* point = static_cast(data); + if (point->state == EVAS_TOUCH_POINT_STILL) { + // Chromium doesn't expect (and doesn't like) these events. + continue; + } + if (rwhv()) { + Evas_Coord_Point pt; + pt.x = point->x; + pt.y = point->y; + ui::TouchEvent touch_event = MakeTouchEvent( + pt, point->state, point->id, evas_object()); + rwhv()->HandleTouchEvent(&touch_event); + } + } +} + /* FIXME: Figure out wher this code should be placed. void EWebView::DispatchPostponedGestureEvent(ui::GestureEvent* event) { Ewk_Settings* settings = GetSettings(); diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index 078e2d1..e166946 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -31,6 +31,7 @@ #include "base/id_map.h" #include "context_menu_controller_efl.h" #include "eweb_context.h" +#include "ewk_touch.h" #include "private/ewk_hit_test_private.h" #include "private/ewk_auth_challenge_private.h" #include "private/ewk_settings_private.h" @@ -61,11 +62,9 @@ #include "tizen_webview/public/tw_back_forward_history.h" #include "tizen_webview/public/tw_back_forward_list_impl.h" #include "tizen_webview/public/tw_hit_test.h" -#include "tizen_webview/public/tw_touch_event.h" #include "tizen_webview/public/tw_callbacks.h" #include "tizen_webview/public/tw_content_security_policy.h" #include "tizen_webview/public/tw_find_options.h" -#include "tizen_webview/public/tw_touch_event.h" namespace content { class RenderViewHost; @@ -279,6 +278,7 @@ class EWebView { void SetTouchEventsEnabled(bool enabled); bool MouseEventsEnabled() const; void SetMouseEventsEnabled(bool enabled); + void HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers); void Show(); void Hide(); bool ExecuteJavaScript(const char* script, tizen_webview::View_Script_Execute_Callback callback, void* userdata); diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index 9b6330a..4711abe 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -758,15 +758,11 @@ void ewk_view_back_forward_list_clear(const Evas_Object *view) Eina_Bool ewk_view_feed_touch_event(Evas_Object *view, Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers) { -#if defined(EWK_REFACTOR) EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false); - impl->HandleTouchEvents(chromium_glue::to(type), points, modifiers); + impl->HandleTouchEvents(type, points, modifiers); return true; -#else - LOG_EWK_API_MOCKUP("Not Supported by chromium"); -#endif } Eina_Bool ewk_view_touch_events_enabled_set(Evas_Object *view, Eina_Bool enabled) diff --git a/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.cc b/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.cc index 4f1b623..5d34dba 100644 --- a/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.cc +++ b/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.cc @@ -339,6 +339,10 @@ void WebView::SetTouchEventsEnabled(bool enabled) { return impl_->SetTouchEventsEnabled(enabled); } +void WebView::HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *point, const Evas_Modifier *modifiers) { + return impl_->HandleTouchEvents(type, point, modifiers); +} + Hit_Test* WebView::RequestHitTestDataAt(int x, int y, Hit_Test_Mode mode) { return impl_->RequestHitTestDataAt(x, y, mode); } diff --git a/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.h b/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.h index 7fc6f0a..8a30b4c 100644 --- a/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.h +++ b/tizen_src/ewk/efl_integration/tizen_webview/public/tw_webview.h @@ -18,7 +18,7 @@ #include "tizen_webview/public/tw_hit_test.h" #include "tizen_webview/public/tw_find_options.h" #include "tizen_webview/public/tw_macro.h" -#include "tizen_webview/public/tw_touch_event.h" +#include "ewk_touch.h" #include "third_party/WebKit/public/web/WebViewModeEnums.h" // TODO: Remove this dependency @@ -149,6 +149,7 @@ class WebView { // ---- Touch & Hit Test bool TouchEventsEnabled() const; void SetTouchEventsEnabled(bool enabled); + void HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *point, const Evas_Modifier *modifiers); Hit_Test* RequestHitTestDataAt(int x, int y, Hit_Test_Mode mode); Eina_Bool AsyncRequestHitTestDataAt(int x, int y, tizen_webview::Hit_Test_Mode mode, tizen_webview::View_Hit_Test_Request_Callback, void* user_data);