[M69 Dev][Tizen] Enable touch events for mobile/wearable profile 46/193146/2
authorChandan Padhi <c.padhi@samsung.com>
Wed, 14 Nov 2018 13:23:44 +0000 (18:53 +0530)
committerBot Blink <blinkbot@samsung.com>
Thu, 15 Nov 2018 09:13:20 +0000 (09:13 +0000)
This commit enables touch and gestures handling.

Change-Id: I1a1602502f22452d583357d772fd3a829ac9074f
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc
tizen_src/ewk/efl_integration/command_line_efl.cc
tizen_src/ewk/efl_integration/eweb_view.cc

index 99e771c..b22225e 100644 (file)
@@ -1428,21 +1428,16 @@ void RenderWidgetHostViewEfl::HandleGesture(blink::WebGestureEvent& event) {
 }
 
 void RenderWidgetHostViewEfl::HandleGesture(ui::GestureEvent* event) {
-  blink::WebGestureEvent gesture = MakeWebGestureEventFromUIEvent(*event);
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
-  gesture.x = event->x();
-  gesture.y = event->y();
-
-  const gfx::Point root_point = event->root_location();
-  gesture.global_x = root_point.x();
-  gesture.global_y = root_point.y();
-#endif
   if (event->type() == ui::ET_GESTURE_BEGIN)
     HandleGestureBegin();
   else if (event->type() == ui::ET_GESTURE_END)
     HandleGestureEnd();
 
-  SendGestureEvent(gesture);
+  blink::WebGestureEvent gesture_event = MakeWebGestureEventFromUIEvent(*event);
+  gesture_event.SetPositionInWidget(event->location_f());
+  gesture_event.SetPositionInScreen(event->root_location_f());
+  SendGestureEvent(gesture_event);
+
   event->SetHandled();
 }
 
@@ -1473,18 +1468,11 @@ void RenderWidgetHostViewEfl::ProcessAckedTouchEvent(
   ui::EventResult result = (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED)
                                ? ui::ER_HANDLED
                                : ui::ER_UNHANDLED;
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
-  std::unique_ptr<ui::GestureRecognizer::Gestures> gestures;
-  gestures.reset(gesture_recognizer_->AckTouchEvent(
-      touch.event.unique_touch_event_id, result, this));
-
-  if (gestures) {
-    for (size_t j = 0; j < gestures->size(); ++j) {
-      ui::GestureEvent* event = gestures.at(j);
-      HandleGesture(event);
-    }
-  }
-#endif  // !defined(EWK_BRINGUP)
+  ui::GestureRecognizer::Gestures gestures = gesture_recognizer_->AckTouchEvent(
+      touch.event.unique_touch_event_id, result,
+      false /* is_source_touch_event_set_non_blocking */, this);
+  for (const auto& event : gestures)
+    HandleGesture(event.get());
 }
 
 EdgeEffect& RenderWidgetHostViewEfl::EnsureEdgeEffect() {
index 8478c47..809e86b 100644 (file)
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/web_contents_view_delegate.h"
 #include "content/public/browser/web_contents_view_efl_delegate.h"
+#include "content/public/common/content_switches.h"
 #include "efl/window_factory.h"
 #include "tizen/system_info.h"
 #include "ui/display/screen_efl.h"
-#include "ui/events/event_switches.h"
 #include "ui/gfx/image/image_skia.h"
 #include "ui/gl/gl_shared_context_efl.h"
 
@@ -46,13 +46,12 @@ WebContentsViewEfl::WebContentsViewEfl(WebContents* contents,
       touch_enabled_(IsMobileProfile() || IsWearableProfile()),
       page_scale_factor_(1.0f),
       web_contents_(contents) {
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
   base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
-  if (cmdline->HasSwitch(switches::kTouchEvents)) {
-    touch_enabled_ = cmdline->GetSwitchValueASCII(switches::kTouchEvents) ==
-                     switches::kTouchEventsEnabled;
+  if (cmdline->HasSwitch(switches::kTouchEventFeatureDetection)) {
+    touch_enabled_ =
+        cmdline->GetSwitchValueASCII(switches::kTouchEventFeatureDetection) ==
+        switches::kTouchEventFeatureDetectionEnabled;
   }
-#endif
 }
 
 WebContentsViewEfl::~WebContentsViewEfl() {}
index 21fca0a..573710e 100644 (file)
@@ -21,7 +21,6 @@
 #include "tizen/system_info.h"
 #include "ui/base/ui_base_switches.h"
 #include "ui/events/event_switches.h"
-#include "ui/events/event_switches.h"
 #include "url/gurl.h"
 
 int CommandLineEfl::argc_ = 0;
@@ -78,9 +77,10 @@ content::MainFunctionParams CommandLineEfl::GetDefaultPortParams() {
 
   if (IsMobileProfile() || IsWearableProfile()) {
     p_command_line->AppendSwitch(switches::kUseMobileUserAgent);
+    p_command_line->AppendSwitchASCII(
+        switches::kTouchEventFeatureDetection,
+        switches::kTouchEventFeatureDetectionEnabled);
 #if !defined(EWK_BRINGUP)
-    p_command_line->AppendSwitchASCII(switches::kTouchEvents,
-                                      switches::kTouchEventsEnabled);
     p_command_line->AppendSwitch(switches::kEnablePinch);
     // [M42_2231] FIXME: Need Parallel Canvas patch for S-Chromium/S-Blink/S-Skia
     p_command_line->AppendSwitchASCII(
index e970a20..cbd30bd 100644 (file)
@@ -35,6 +35,7 @@
 #include "content/public/browser/navigation_entry.h"
 #include "content/public/browser/resource_dispatcher_host.h"
 #include "content/public/common/content_client.h"
+#include "content/public/common/content_switches.h"
 #include "content/public/common/user_agent.h"
 #include "permission_popup_manager.cc"
 #include "private/ewk_back_forward_list_private.h"
@@ -53,7 +54,6 @@
 #include "tizen/system_info.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/display/screen.h"
-#include "ui/events/event_switches.h"
 #include "web_contents_delegate_efl.h"
 #include "web_contents_efl_delegate_ewk.h"
 #include "web_contents_view_efl_delegate_ewk.h"
@@ -193,13 +193,14 @@ void EWebView::Initialize() {
   settings_.reset(new Ewk_Settings(
       evas_object_,
       web_contents_->GetRenderViewHost()->GetWebkitPreferences()));
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
   base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
-  if (cmdline->HasSwitch(switches::kTouchEvents))
-    SetTouchEventsEnabled(true);
-  else
-#endif
+  if (cmdline->HasSwitch(switches::kTouchEventFeatureDetection)) {
+    SetTouchEventsEnabled(
+        cmdline->GetSwitchValueASCII(switches::kTouchEventFeatureDetection) ==
+        switches::kTouchEventFeatureDetectionEnabled);
+  } else {
     SetMouseEventsEnabled(true);
+  }
 
   popupMenuItems_ = 0;
   popupPicker_ = 0;