[M120 Migration] Provide ewk_settings_ime_panel_enabled_set api 06/309706/3
authorfangfengrong <fr.fang@samsung.com>
Tue, 16 Apr 2024 02:18:39 +0000 (10:18 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 18 Apr 2024 02:44:18 +0000 (02:44 +0000)
1. Provide ewk_settings_ime_panel_enabled_set api to
   set if enable ime panel with true or false;
2. Check the IMEPanelEnabled value before show ime panel,
   the value is false, then don't show ime panel.

Reference:
 https://review.tizen.org/gerrit/#/c/290341

Change-Id: Ie1764c9d326a96e964fa87d9a83eb4c8e8ecc635
Signed-off-by: fangfengrong <fr.fang@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.cc
tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_aura_helper_efl.cc
tizen_src/ewk/efl_integration/private/ewk_settings_private.h
tizen_src/ewk/efl_integration/public/ewk_settings.cc
tizen_src/ewk/efl_integration/webview_delegate_efl.cc

index f07a065..031d24a 100644 (file)
@@ -383,6 +383,22 @@ void RWHVAuraCommonHelperEfl::TextInputStateChanged(
 
   bool show_ime_if_needed = params.show_ime_if_needed;
 
+  WebContentsViewAuraHelperEfl* wcve = nullptr;
+  if (web_contents_) {
+    WebContentsImpl* wci = static_cast<WebContentsImpl*>(web_contents_);
+    if (wci) {
+      WebContentsViewAura* wcva =
+          static_cast<WebContentsViewAura*>(wci->GetView());
+      if (wcva)
+        wcve = wcva->wcva_helper();
+    }
+  }
+
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (show_ime_if_needed && wcve && !wcve->ImePanelEnabled())
+    show_ime_if_needed = false;
+#endif
+
   if (show_ime_if_needed && !params.is_user_action)
     show_ime_if_needed = false;
 
index ad4f365..c67dd14 100644 (file)
@@ -153,10 +153,8 @@ void WebContentsViewAuraHelperEfl::CancelContextMenu(int request_id) {
 }
 
 bool WebContentsViewAuraHelperEfl::ImePanelEnabled() const {
-#if !defined(EWK_BRINGUP)
   if (webview_delegate_)
     return webview_delegate_->ImePanelEnabled();
-#endif
   return true;
 }
 
index d39c63a..fd5ab0f 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; }
+    bool imePanelEnabled() const { return m_imePanelEnabled; }
+    void setImePanelEnabled(bool enable) { m_imePanelEnabled = enable; }
     void setTouchFocusEnabled(bool enable) { m_touchFocusEnabled = enable; }
     bool touchFocusEnabled() const { return m_touchFocusEnabled; }
     void setClipboardEnabled(bool enable) { m_clipboardEnabled = enable; }
@@ -127,6 +129,7 @@ class Ewk_Settings {
    bool m_openPanelEnabled = true;
    bool m_allowRestrictedURL = true;
    bool m_URLBarHide = false;
+   bool m_imePanelEnabled = true;
    bool m_touchFocusEnabled = true;
    bool m_clipboardEnabled = false;
 };
index 87e81e0..a19e4e0 100644 (file)
@@ -921,13 +921,15 @@ void ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bo
 
 void ewk_settings_ime_panel_enabled_set(Ewk_Settings* settings, Eina_Bool Enabled)
 {
-  LOG_EWK_API_MOCKUP();
+  EINA_SAFETY_ON_NULL_RETURN(settings);
+  LOG(INFO)<<"ewk_settings_ime_panel_enabled_set, enabled:"<<(bool)Enabled;
+  settings->setImePanelEnabled(Enabled);
 }
 
 Eina_Bool ewk_settings_ime_panel_enabled_get(const Ewk_Settings *settings)
 {
-  LOG_EWK_API_MOCKUP();
-  return EINA_FALSE;
+  EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+  return settings->imePanelEnabled();
 }
 
 Eina_Bool ewk_settings_allow_file_access_from_external_url_set(Ewk_Settings* settings, Eina_Bool allow)
index bf90bd4..780d461 100644 (file)
@@ -93,8 +93,7 @@ void WebViewDelegateEfl::OnOverscrolled(
 }
 
 bool WebViewDelegateEfl::ImePanelEnabled() const {
-  NOTIMPLEMENTED();
-  return false;
+  return web_view_->GetSettings()->imePanelEnabled();
 }
 
 bool WebViewDelegateEfl::ImeHandleKeyEventEnabled() const {