diff --git a/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.cpp b/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.cpp index 4438eb6ca2a3a9eb1789963fc866b7078b5673a5..a75b442d6fbaf67a6e43d41075b1c487d6c1182c 100644 --- a/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.cpp +++ b/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.cpp @@ -153,6 +153,8 @@ constexpr char WEB_CACHE_MODE[] = "cacheMode"; constexpr char NTC_CACHE_MODE[] = "cacheMode"; constexpr char WEB_IMAGE_ACCESS[] = "imageAccess"; constexpr char NTC_IMAGE_ACCESS[] = "imageAccess"; +constexpr char WEB_TEXT_ZOOM_RATIO[] = "textZoomRatio"; +constexpr char NTC_TEXT_ZOOM_RATIO[] = "textZoomRatio"; const char WEB_PARAM_NONE[] = ""; const char WEB_PARAM_AND[] = "#HWJS-&-#"; @@ -1921,7 +1923,18 @@ void WebDelegateCross::UpdateDatabaseEnabled(const bool& isDatabaseAccessEnabled {} void WebDelegateCross::UpdateTextZoomRatio(const int32_t& textZoomRatioNum) -{} +{ + if (textZoomRatioNum < 0 || textZoomRatioNum > INT32_MAX) { + TAG_LOGE(AceLogTag::ACE_WEB, "textZoomRatioNum is out of range"); + return; + } + hash_ = MakeResourceHash(); + updateTextZoomRatioMethod_ = MakeMethodHash(WEB_TEXT_ZOOM_RATIO); + std::stringstream paramStream; + paramStream << NTC_TEXT_ZOOM_RATIO << WEB_PARAM_EQUALS << textZoomRatioNum; + std::string param = paramStream.str(); + CallResRegisterMethod(updateTextZoomRatioMethod_, param, nullptr); +} void WebDelegateCross::UpdateWebDebuggingAccess(bool isWebDebuggingAccessEnabled) {} diff --git a/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.h b/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.h index 2a726a9077a7f81e5f39edeca3a07a04bfdfb691..01d6e9e81a92ceac1bd2a4c04ec3eb3b4754fd8a 100644 --- a/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.h +++ b/frameworks/core/components_ng/pattern/web/cross_platform/web_delegate_cross.h @@ -549,6 +549,7 @@ private: Method updateVerticalScrollBarAccess_; Method updateBackgroundColor_; Method updateMediaPlayGestureAccess_; + Method updateTextZoomRatioMethod_; EventCallbackV2 onPageFinishedV2_; EventCallbackV2 onPageStartedV2_;