From: dongsug.song Date: Wed, 4 Sep 2024 10:06:04 +0000 (+0900) Subject: [Tizen] Add WebAuthDisplayQR and Response for QR code passkey in WebView X-Git-Tag: accepted/tizen/7.0/unified/20240924.164220~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fbf15cf817ea76c19c2024739a112059b148da2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [Tizen] Add WebAuthDisplayQR and Response for QR code passkey in WebView Change-Id: I85ab00b654952da5815ef66d870802c0ed38069a --- diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.cpp b/dali-toolkit/devel-api/controls/web-view/web-view.cpp index 422acfd1d0..639b1c8288 100755 --- a/dali-toolkit/devel-api/controls/web-view/web-view.cpp +++ b/dali-toolkit/devel-api/controls/web-view/web-view.cpp @@ -444,6 +444,21 @@ void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceive Dali::Toolkit::GetImpl(*this).GetPlainTextAsynchronously(callback); } +void WebView::WebAuthenticationCancel() +{ + Dali::Toolkit::GetImpl(*this).WebAuthenticationCancel(); +} + +void WebView::RegisterWebAuthDisplayQRCallback(Dali::WebEnginePlugin::WebEngineWebAuthDisplayQRCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterWebAuthDisplayQRCallback(callback); +} + +void WebView::RegisterWebAuthResponseCallback(Dali::WebEnginePlugin::WebEngineWebAuthResponseCallback callback) +{ + Dali::Toolkit::GetImpl(*this).RegisterWebAuthResponseCallback(callback); +} + WebView::WebView(Internal::WebView& implementation) : Control(implementation) { diff --git a/dali-toolkit/devel-api/controls/web-view/web-view.h b/dali-toolkit/devel-api/controls/web-view/web-view.h index 7585bab85f..e7be860761 100755 --- a/dali-toolkit/devel-api/controls/web-view/web-view.h +++ b/dali-toolkit/devel-api/controls/web-view/web-view.h @@ -796,6 +796,25 @@ public: */ void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback); + /** + * @brief Cancel WebAuthentication(cancel in progress passkey operation). + */ + void WebAuthenticationCancel(); + + /** + * @brief Register WebAuthDisplayQR callback. + * + * @param[in] callback The callback informs browser app to display QR code popup for passkey scenario. + */ + void RegisterWebAuthDisplayQRCallback(Dali::WebEnginePlugin::WebEngineWebAuthDisplayQRCallback callback); + + /** + * @brief Register WebAuthResponse callback. + * + * @param[in] callback The callback informs browser app that the passkey registration and authentication has been successful and app can close QR popup. + */ + void RegisterWebAuthResponseCallback(Dali::WebEnginePlugin::WebEngineWebAuthResponseCallback callback); + public: // Not intended for application developers /// @cond internal /** diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp index d2902e70d4..649761cd2c 100755 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp @@ -828,6 +828,30 @@ void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceive } } +void WebView::WebAuthenticationCancel() +{ + if(mWebEngine) + { + mWebEngine.WebAuthenticationCancel(); + } +} + +void WebView::RegisterWebAuthDisplayQRCallback(Dali::WebEnginePlugin::WebEngineWebAuthDisplayQRCallback callback) +{ + if(mWebEngine) + { + mWebEngine.RegisterWebAuthDisplayQRCallback(std::move(callback)); + } +} + +void WebView::RegisterWebAuthResponseCallback(Dali::WebEnginePlugin::WebEngineWebAuthResponseCallback callback) +{ + if(mWebEngine) + { + mWebEngine.RegisterWebAuthResponseCallback(std::move(callback)); + } +} + void WebView::OnFrameRendered() { if(mFrameRenderedCallback) diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.h b/dali-toolkit/internal/controls/web-view/web-view-impl.h index 94e3f376d7..3acd43111e 100755 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.h +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.h @@ -443,6 +443,21 @@ public: */ void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback); + /** + * @copydoc Dali::Toolkit::WebView::WebAuthenticationCancel() + */ + void WebAuthenticationCancel(); + + /** + * @copydoc Dali::Toolkit::WebView::RegisterWebAuthDisplayQRCallback() + */ + void RegisterWebAuthDisplayQRCallback(Dali::WebEnginePlugin::WebEngineWebAuthDisplayQRCallback callback); + + /** + * @copydoc Dali::Toolkit::WebView::RegisterWebAuthResponseCallback() + */ + void RegisterWebAuthResponseCallback(Dali::WebEnginePlugin::WebEngineWebAuthResponseCallback callback); + public: // Properties /** * @brief Called when a property of an object of this type is set.