[M108 Migration] Add "touch,focus" in ewk_settings_extra_feature_set/get 61/288661/3
authorayush.k123 <ayush.k123@samsung.com>
Tue, 21 Feb 2023 03:59:03 +0000 (09:29 +0530)
committerBot Blink <blinkbot@samsung.com>
Tue, 21 Feb 2023 22:01:03 +0000 (22:01 +0000)
This patch enables the capturing of touch and focus activities of the
user when user touches on screen.

Reference: https://review.tizen.org/gerrit/282018/

Change-Id: I09131483b3adef94fa2efea209586034ff7db232
Signed-off-by: Ayush Kumar <ayush.k123@samsung.com>
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/private/ewk_settings_private.h
tizen_src/ewk/efl_integration/public/ewk_settings.cc

index 3c3e501..4638300 100644 (file)
@@ -822,6 +822,12 @@ void EWebView::HandleTouchEvents(Ewk_Touch_Event_Type type,
                                  const Evas_Modifier* modifiers) {
   const Eina_List* l;
   void* data;
+
+  if (GetSettings()->touchFocusEnabled() &&
+      (type == EWK_TOUCH_START && eina_list_count(points) == 1)) {
+    SetFocus(EINA_TRUE);
+  }
+
   EINA_LIST_FOREACH(points, l, data) {
     const Ewk_Touch_Point* point = static_cast<Ewk_Touch_Point*>(data);
     if (point->state == EVAS_TOUCH_POINT_STILL) {
index 8e200ba..f1fa82b 100644 (file)
@@ -90,6 +90,8 @@ class Ewk_Settings {
     bool getAllowRestrictedURLEnabled() const { return m_allowRestrictedURL; }
     void setURLBarHideEnabled(bool enable) { m_URLBarHide = enable; }
     bool getURLBarHideEnabled() const { return m_URLBarHide; }
+    void setTouchFocusEnabled(bool enable) { m_touchFocusEnabled = enable; }
+    bool touchFocusEnabled() const { return m_touchFocusEnabled; }
 
   private:
    WebPreferences m_preferences;
@@ -123,6 +125,7 @@ class Ewk_Settings {
    bool m_openPanelEnabled = true;
    bool m_allowRestrictedURL = true;
    bool m_URLBarHide = false;
+   bool m_touchFocusEnabled = true;
 };
 
 #endif // ewk_settings_private_h
index ba3bfe7..ea62255 100644 (file)
@@ -733,6 +733,9 @@ Eina_Bool ewk_settings_extra_feature_get(const Ewk_Settings* settings, const cha
     return settings->getPreferences().long_press_enabled;
   else if (base::EqualsCaseInsensitiveASCII(feature_name, "doubletap,enable"))
     return settings->getPreferences().double_tap_to_zoom_enabled;
+  else if (base::EqualsCaseInsensitiveASCII(feature_name, "touch,focus"))
+    return settings->touchFocusEnabled();
+
   return EINA_FALSE;
 }
 
@@ -753,6 +756,8 @@ void ewk_settings_extra_feature_set(Ewk_Settings* settings, const char* feature,
     settings->getPreferences().long_press_enabled = enable;
   else if (base::EqualsCaseInsensitiveASCII(feature_name, "doubletap,enable"))
     settings->getPreferences().double_tap_to_zoom_enabled = enable;
+  else if (base::EqualsCaseInsensitiveASCII(feature_name, "touch,focus"))
+    settings->setTouchFocusEnabled(enable);
 }
 
 Eina_Bool ewk_settings_tizen_compatibility_mode_set(Ewk_Settings* settings, unsigned major, unsigned minor, unsigned release)