From cfe4e99f12f0d7663b52b579be3f837f283afd38 Mon Sep 17 00:00:00 2001 From: wuliubao Date: Tue, 2 Sep 2025 21:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=8F=E4=BC=A0=E8=87=AA=E7=94=B1=E5=A4=9A?= =?UTF-8?q?=E7=AA=97=E5=92=8CPC=E6=A8=A1=E5=BC=8F=20IssueNo:#ICW276=20Desc?= =?UTF-8?q?ription:=20Sig:=20SIG=5FApplicationFramework=20Feature=20or=20B?= =?UTF-8?q?ugfix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuliubao --- ohos_interface/include/ohos_nweb/nweb.h | 12 ++++++++++++ .../ohos_nweb/bridge/webcore/ark_web_nweb_impl.cpp | 10 ++++++++++ .../ohos_nweb/bridge/webcore/ark_web_nweb_impl.h | 12 ++++++++++++ .../bridge/webview/ark_web_nweb_wrapper.cpp | 10 ++++++++++ .../bridge/webview/ark_web_nweb_wrapper.h | 12 ++++++++++++ .../ohos_glue/ohos_nweb/include/ark_web_nweb.h | 14 ++++++++++++++ 6 files changed, 70 insertions(+) diff --git a/ohos_interface/include/ohos_nweb/nweb.h b/ohos_interface/include/ohos_nweb/nweb.h index cac2ae80f..36289f700 100644 --- a/ohos_interface/include/ohos_nweb/nweb.h +++ b/ohos_interface/include/ohos_nweb/nweb.h @@ -2150,6 +2150,18 @@ public: */ /*--ark web()--*/ virtual void SetForceEnableZoom(bool forceEnableZoom) const {} + + /** + * @brief Notify is pc window or not. + * @param True means pc window, false means the opposite. + */ + virtual void NotifyIsPcWindow(bool result) {} + + /** + * @brief Notify whether the free multi window mode is enabled or not. + * @param true means the free multi window mode is enabled, false means the opposite. + */ + virtual void NotifyFreeMultiWindowModeEnabled(bool result) {} }; } // namespace OHOS::NWeb diff --git a/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.cpp b/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.cpp index 62180b83e..f41cb3f83 100644 --- a/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.cpp +++ b/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.cpp @@ -1599,4 +1599,14 @@ void ArkWebNWebImpl::SetForceEnableZoom(bool forceEnableZoom) nweb_nweb_->SetForceEnableZoom(forceEnableZoom); } +void ArkWebNWebImpl::NotifyIsPcWindow(bool result) +{ + nweb_nweb_->NotifyIsPcWindow(result); +} + +void ArkWebNWebImpl::NotifyFreeMultiWindowModeEnabled(bool result) +{ + nweb_nweb_->NotifyFreeMultiWindowModeEnabled(result); +} + } // namespace OHOS::ArkWeb diff --git a/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.h b/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.h index 313f99ee5..99c82a0a0 100644 --- a/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.h +++ b/ohos_interface/ohos_glue/ohos_nweb/bridge/webcore/ark_web_nweb_impl.h @@ -1806,6 +1806,18 @@ public: */ /*--ark web()--*/ void SetForceEnableZoom(bool forceEnableZoom) override; + + /** + * @brief Notify is pc window or not. + * @param True means pc window, false means the opposite. + */ + void NotifyIsPcWindow(bool result) override; + + /** + * @brief Notify whether the free multi window mode is enabled or not. + * @param true means the free multi window mode is enabled, false means the opposite. + */ + void NotifyFreeMultiWindowModeEnabled(bool result) override; private: std::shared_ptr nweb_nweb_; }; diff --git a/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.cpp b/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.cpp index 18e95b4b7..63b776bfe 100644 --- a/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.cpp +++ b/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.cpp @@ -1885,4 +1885,14 @@ void ArkWebNWebWrapper::SetForceEnableZoom(bool forceEnableZoom) const WVLOG_E("forceEnableZoom = %{public}d", forceEnableZoom); ark_web_nweb_->SetForceEnableZoom(forceEnableZoom); } + +void ArkWebNWebWrapper::NotifyIsPcWindow(bool result) +{ + ark_web_nweb_->NotifyIsPcWindow(result); +} + +void ArkWebNWebWrapper::NotifyFreeMultiWindowModeEnabled(bool result) +{ + ark_web_nweb_->NotifyFreeMultiWindowModeEnabled(result); +} } // namespace OHOS::ArkWeb diff --git a/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.h b/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.h index f73a70690..b609dc39f 100644 --- a/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.h +++ b/ohos_interface/ohos_glue/ohos_nweb/bridge/webview/ark_web_nweb_wrapper.h @@ -1819,6 +1819,18 @@ public: * @brief Set web should ignore zoom limit. */ void SetForceEnableZoom(bool forceEnableZoom) const override; + + /** + * @brief Notify is pc window or not. + * @param True means pc window, false means the opposite. + */ + void NotifyIsPcWindow(bool result) override; + + /** + * @brief Notify whether the free multi window mode is enabled or not. + * @param true means the free multi window mode is enabled, false means the opposite. + */ + void NotifyFreeMultiWindowModeEnabled(bool result) override; private: ArkWebRefPtr ark_web_nweb_; }; diff --git a/ohos_interface/ohos_glue/ohos_nweb/include/ark_web_nweb.h b/ohos_interface/ohos_glue/ohos_nweb/include/ark_web_nweb.h index b57dbd943..697a09b66 100644 --- a/ohos_interface/ohos_glue/ohos_nweb/include/ark_web_nweb.h +++ b/ohos_interface/ohos_glue/ohos_nweb/include/ark_web_nweb.h @@ -2052,6 +2052,20 @@ public: */ /*--ark web()--*/ virtual void SetForceEnableZoom(bool forceEnableZoom) {} + + /** + * @brief Notify is pc window or not. + * @param True means pc window, false means the opposite. + */ + /*--ark web()--*/ + virtual void NotifyIsPcWindow(bool result) = 0; + + /** + * @brief Notify whether the free multi window mode is enabled or not. + * @param true means the free multi window mode is enabled, false means the opposite. + */ + /*--ark web()--*/ + virtual void NotifyFreeMultiWindowModeEnabled(bool result) = 0; }; } // namespace OHOS::ArkWeb -- Gitee