From: Bakka Uday Kiran Date: Thu, 16 Feb 2023 07:01:52 +0000 (+0530) Subject: [M108 Migration] Handle settings in WebPreferences and WebViewImpl X-Git-Tag: submit/tizen/20230227.160252~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b60219e4794dbf07493be9f539553d46a2655c8f;p=platform%2Fframework%2Fweb%2Fchromium-efl.git [M108 Migration] Handle settings in WebPreferences and WebViewImpl This patch handled settings in WebPreferences and WebViewImpl Reference: https://review.tizen.org/gerrit/c/282203 Change-Id: I2879dec16b3a7dc2490ac2cf63d6659aa2dda1ad Signed-off-by: Bakka Uday Kiran --- diff --git a/third_party/blink/common/web_preferences/web_preferences.cc b/third_party/blink/common/web_preferences/web_preferences.cc index f58b446..f8dfa24 100644 --- a/third_party/blink/common/web_preferences/web_preferences.cc +++ b/third_party/blink/common/web_preferences/web_preferences.cc @@ -11,6 +11,7 @@ #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/mojom/v8_cache_options.mojom.h" #include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom.h" +#include "tizen_src/chromium_impl/tizen/system_info.h" #include "ui/base/ui_base_switches_util.h" namespace { @@ -231,6 +232,12 @@ WebPreferences::WebPreferences() // may be refined via resource files for the Chrome profile, in order to take // into account platform-specific availability of math fonts. math_font_family_map[web_pref::kCommonScript] = u"Latin Modern Math"; +#if BUILDFLAG(IS_EFL) + if (IsMobileProfile()) { + shrinks_viewport_contents_to_fit = true; + link_effect_enabled = true; + } +#endif } WebPreferences::WebPreferences(const WebPreferences& other) = default; diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc index 2b11003..4f0fc8b 100644 --- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc +++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc @@ -164,6 +164,7 @@ bool StructTraitstext_autosizing_enabled = data.text_autosizing_enabled(); #if BUILDFLAG(IS_EFL) out->force_enable_zoom = data.force_enable_zoom(); + out->link_effect_enabled = data.link_effect_enabled(); #endif #if BUILDFLAG(IS_TIZEN) out->max_refresh_rate = data.max_refresh_rate(); diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index b88bd2e..ed5849a 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -1698,6 +1698,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, settings->SetDontSendKeyEventsToJavascript( prefs.dont_send_key_events_to_javascript); settings->SetWebAppScope(WebString::FromASCII(prefs.web_app_scope.spec())); + settings->SetLoadWithOverviewMode(prefs.initialize_at_minimum_page_scale); #if defined(TIZEN_ATK_SUPPORT) settings->SetAccessibilityEnabled(prefs.atk_enabled); #endif @@ -1707,11 +1708,11 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, prefs.tizen_version_minor, prefs.tizen_version_release); web_view_impl->SetIgnoreViewportTagScaleLimits(prefs.force_enable_zoom); + settings->SetLoadWithOverviewMode(prefs.shrinks_viewport_contents_to_fit); #endif #if BUILDFLAG(IS_TIZEN) - if (IsMobileProfile()) - settings->SetLinkEffectEnabled(true); + settings->SetLinkEffectEnabled(prefs.link_effect_enabled); #endif #if BUILDFLAG(IS_ANDROID) @@ -1772,7 +1773,6 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, settings->SetAutoZoomFocusedEditableToLegibleScale( prefs.auto_zoom_focused_editable_to_legible_scale); - settings->SetLoadWithOverviewMode(prefs.initialize_at_minimum_page_scale); settings->SetMainFrameResizesAreOrientationChanges( prefs.main_frame_resizes_are_orientation_changes); diff --git a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h index f4b972d..84ab6c7 100644 --- a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h +++ b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h @@ -35,9 +35,7 @@ IPC_STRUCT_TRAITS_BEGIN(Ewk_Wrt_Message_Data) IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(WebPreferencesEfl) - IPC_STRUCT_TRAITS_MEMBER(shrinks_viewport_content_to_fit) IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically_ewk) - IPC_STRUCT_TRAITS_MEMBER(link_effect_enabled) IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data) diff --git a/tizen_src/ewk/efl_integration/common/web_preferences_efl.h b/tizen_src/ewk/efl_integration/common/web_preferences_efl.h index f9c5bda..0eb5693 100644 --- a/tizen_src/ewk/efl_integration/common/web_preferences_efl.h +++ b/tizen_src/ewk/efl_integration/common/web_preferences_efl.h @@ -5,15 +5,10 @@ #ifndef WEB_PREFERENCES_EFL_H #define WEB_PREFERENCES_EFL_H -#include "tizen/system_info.h" - // Contains settings from Ewk_Settings that do not belong to content::WebPreferences // and need to be sent to renderer. struct WebPreferencesEfl { - bool shrinks_viewport_content_to_fit = - IsMobileProfile() || IsWearableProfile() ? true : false; bool javascript_can_open_windows_automatically_ewk = true; - bool link_effect_enabled = true; }; #endif // WEB_PREFERENCES_EFL_H diff --git a/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc b/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc index 4570b01..04dcfa7 100644 --- a/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc +++ b/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc @@ -25,6 +25,7 @@ #include "net/traffic_annotation/network_traffic_annotation.h" #include "private/ewk_context_menu_private.h" #include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h" +#include "tizen/system_info.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/clipboard_helper_efl.h" diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings.cc b/tizen_src/ewk/efl_integration/public/ewk_settings.cc index 2891cd8..321b23b 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_settings.cc @@ -127,7 +127,7 @@ Eina_Bool ewk_settings_plugins_enabled_get(const Ewk_Settings* settings) Eina_Bool ewk_settings_auto_fitting_set(Ewk_Settings* settings, Eina_Bool enable) { EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false); - settings->getPreferencesEfl().shrinks_viewport_content_to_fit = enable; + settings->getPreferences().shrinks_viewport_contents_to_fit = enable; ewkUpdateWebkitPreferences(settings->getEvasObject()); return EINA_TRUE; } @@ -135,7 +135,7 @@ Eina_Bool ewk_settings_auto_fitting_set(Ewk_Settings* settings, Eina_Bool enable Eina_Bool ewk_settings_auto_fitting_get(const Ewk_Settings* settings) { EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false); - return settings->getPreferencesEfl().shrinks_viewport_content_to_fit; + return settings->getPreferences().shrinks_viewport_contents_to_fit; } Eina_Bool ewk_settings_force_zoom_set(Ewk_Settings* settings, Eina_Bool enable) @@ -321,7 +321,7 @@ Eina_Bool ewk_settings_link_magnifier_enabled_get(const Ewk_Settings *settings) Eina_Bool ewk_settings_link_effect_enabled_set(Ewk_Settings* settings, Eina_Bool enable) { EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false); - settings->getPreferencesEfl().link_effect_enabled = enable; + settings->getPreferences().link_effect_enabled = enable; ewkUpdateWebkitPreferences(settings->getEvasObject()); return EINA_TRUE; } @@ -329,7 +329,7 @@ Eina_Bool ewk_settings_link_effect_enabled_set(Ewk_Settings* settings, Eina_Bool ewk_settings_link_effect_enabled_get(const Ewk_Settings* settings) { EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false); - return settings->getPreferencesEfl().link_effect_enabled; + return settings->getPreferences().link_effect_enabled; } Eina_Bool ewk_settings_uses_encoding_detector_set(Ewk_Settings* settings, Eina_Bool use)