Add a callback for navigation policy in csharp binder. 84/268484/1
authorhuayong.xu <huayong.xu@samsung.com>
Thu, 23 Dec 2021 10:30:44 +0000 (18:30 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Thu, 23 Dec 2021 10:30:44 +0000 (18:30 +0800)
Change-Id: I4344686986d3d47b3745fb4d026ef3a14b0aac3d

dali-csharp-binder/src/web-view-wrap.cpp

index 8618503..7c90f55 100755 (executable)
@@ -1014,6 +1014,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WebView_RegisterResponsePolicyDecidedCal
   }
 }
 
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WebView_RegisterNavigationPolicyDecidedCallback(void * jarg1, void * jarg2) {
+  Dali::Toolkit::WebView *arg1 = (Dali::Toolkit::WebView *)jarg1;
+  void (*handler)(Dali::WebEnginePolicyDecision*) = (void (*)(Dali::WebEnginePolicyDecision*))jarg2;
+  {
+    try {
+      (arg1)->RegisterNavigationPolicyDecidedCallback([handler](std::unique_ptr<Dali::WebEnginePolicyDecision> decision) {
+            handler(decision.release());
+          });
+    } CALL_CATCH_EXCEPTION();
+  }
+}
+
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_WebView_RegisterCertificateConfirmedCallback(void * jarg1, void * jarg2) {
   Dali::Toolkit::WebView *arg1 = (Dali::Toolkit::WebView *)jarg1;
   void (*handler)(Dali::WebEngineCertificate*) = (void (*)(Dali::WebEngineCertificate*))jarg2;