Revert "[Tizen] Revert "[Web] Fix WebView terminate crash""
[platform/core/uifw/dali-adaptor.git] / dali / internal / web-engine / common / web-engine-impl.cpp
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/web-engine/common/web-engine-impl.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/object/type-registry.h>
24 #include <dlfcn.h>
25 #include <sstream>
26
27 // INTERNAL INCLUDES
28 #include <dali/devel-api/adaptor-framework/environment-variable.h>
29 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h>
30 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
31 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
32 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h>
33 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
34 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h>
35 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-http-auth-handler.h>
36 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-load-error.h>
37 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-policy-decision.h>
38 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h>
39 #include <dali/internal/system/common/environment-variables.h>
40 #include <dali/public-api/adaptor-framework/native-image-source.h>
41 #include <dali/public-api/images/pixel-data.h>
42
43 namespace Dali
44 {
45 namespace Internal
46 {
47 namespace Adaptor
48 {
49 namespace // unnamed namespace
50 {
51 constexpr char const* const kPluginFullNamePrefix  = "libdali2-web-engine-";
52 constexpr char const* const kPluginFullNamePostfix = "-plugin.so";
53 constexpr char const* const kPluginFullNameDefault = "libdali2-web-engine-plugin.so";
54
55 std::string MakePluginName(const char* environmentName)
56 {
57   std::stringstream fullName;
58   fullName << kPluginFullNamePrefix << environmentName << kPluginFullNamePostfix;
59   return std::move(fullName.str());
60 }
61
62 Dali::BaseHandle Create()
63 {
64   return Dali::WebEngine::New();
65 }
66
67 Dali::TypeRegistration type(typeid(Dali::WebEngine), typeid(Dali::BaseHandle), Create);
68
69 /**
70  * @brief Control the WebEnginePlugin library lifecycle.
71  * Hold the plugin library handle in static singletone.
72  * It will makes library handle alives during all WebEngine resources create & destory.
73  */
74 struct WebEnginePluginObject
75 {
76 public:
77   static WebEnginePluginObject& GetInstance()
78   {
79     static WebEnginePluginObject gPluginHandle;
80     return gPluginHandle;
81   }
82
83   /**
84    * @brief Converts an handle to a bool.
85    *
86    * This is useful for checking whether the WebEnginePluginObject succes to load library.
87    * @note We don't check mHandle because it is possible that mHandle load is success but
88    * Create/Destroy API load failed.
89    */
90   explicit operator bool() const
91   {
92     return mLoadSuccess;
93   }
94
95   bool InitializeContextHandle()
96   {
97     if(!mHandle)
98     {
99       return false;
100     }
101
102     if(!mGetWebEngineContextPtr)
103     {
104       mGetWebEngineContextPtr = reinterpret_cast<GetWebEngineContext>(dlsym(mHandle, "GetWebEngineContext"));
105
106       if(!mGetWebEngineContextPtr)
107       {
108         DALI_LOG_ERROR("Can't load symbol GetWebEngineContext(), error: %s\n", dlerror());
109         return false;
110       }
111     }
112
113     return true;
114   }
115
116   bool InitializeCookieManagerHandle()
117   {
118     if(!mHandle)
119     {
120       return false;
121     }
122
123     if(!mGetWebEngineCookieManagerPtr)
124     {
125       mGetWebEngineCookieManagerPtr = reinterpret_cast<GetWebEngineCookieManager>(dlsym(mHandle, "GetWebEngineCookieManager"));
126
127       if(!mGetWebEngineCookieManagerPtr)
128       {
129         DALI_LOG_ERROR("Can't load symbol GetWebEngineCookieManager(), error: %s\n", dlerror());
130         return false;
131       }
132     }
133
134     return true;
135   }
136
137 private:
138   // Private constructor / destructor
139   WebEnginePluginObject()
140   : mPluginName{},
141     mLoadSuccess{false},
142     mHandle{nullptr},
143     mCreateWebEnginePtr{nullptr},
144     mDestroyWebEnginePtr{nullptr},
145     mGetWebEngineContextPtr{nullptr},
146     mGetWebEngineCookieManagerPtr{nullptr}
147   {
148     if(mPluginName.length() == 0)
149     {
150       // mPluginName is not initialized yet.
151       const char* name = EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_WEB_ENGINE_NAME);
152       if(name)
153       {
154         mPluginName = MakePluginName(name);
155       }
156       else
157       {
158         mPluginName = std::string(kPluginFullNameDefault);
159       }
160     }
161
162     mHandle = dlopen(mPluginName.c_str(), RTLD_LAZY);
163     if(!mHandle)
164     {
165       DALI_LOG_ERROR("Can't load %s : %s\n", mPluginName.c_str(), dlerror());
166       return;
167     }
168
169     mCreateWebEnginePtr = reinterpret_cast<CreateWebEngineFunction>(dlsym(mHandle, "CreateWebEnginePlugin"));
170     if(mCreateWebEnginePtr == nullptr)
171     {
172       DALI_LOG_ERROR("Can't load symbol CreateWebEnginePlugin(), error: %s\n", dlerror());
173       return;
174     }
175
176     mDestroyWebEnginePtr = reinterpret_cast<DestroyWebEngineFunction>(dlsym(mHandle, "DestroyWebEnginePlugin"));
177     if(mDestroyWebEnginePtr == nullptr)
178     {
179       DALI_LOG_ERROR("Can't load symbol DestroyWebEnginePlugin(), error: %s\n", dlerror());
180       return;
181     }
182
183     mLoadSuccess = true;
184   }
185
186   ~WebEnginePluginObject()
187   {
188     if(mHandle)
189     {
190       dlclose(mHandle);
191       mHandle      = nullptr;
192       mLoadSuccess = false;
193     }
194   }
195
196   WebEnginePluginObject(const WebEnginePluginObject&) = delete;
197   WebEnginePluginObject(WebEnginePluginObject&&)      = delete;
198   WebEnginePluginObject& operator=(const WebEnginePluginObject&) = delete;
199   WebEnginePluginObject& operator=(WebEnginePluginObject&&) = delete;
200
201 private:
202   std::string mPluginName; ///< Name of web engine plugin
203                            /// Note: Dali WebView policy does not allow to use multiple web engines in an application.
204                            /// So once pluginName is set to non-empty string, it will not change.
205
206   bool mLoadSuccess; ///< True if library loaded successfully. False otherwise.
207
208 public:
209   using CreateWebEngineFunction  = Dali::WebEnginePlugin* (*)();
210   using DestroyWebEngineFunction = void (*)(Dali::WebEnginePlugin* plugin);
211
212   using GetWebEngineContext       = Dali::WebEngineContext* (*)();
213   using GetWebEngineCookieManager = Dali::WebEngineCookieManager* (*)();
214
215   void*                    mHandle;              ///< Handle for the loaded library
216   CreateWebEngineFunction  mCreateWebEnginePtr;  ///< Function to create plugin instance
217   DestroyWebEngineFunction mDestroyWebEnginePtr; ///< Function to destroy plugin instance
218
219   GetWebEngineContext       mGetWebEngineContextPtr;       ///< Function to get WebEngineContext
220   GetWebEngineCookieManager mGetWebEngineCookieManagerPtr; ///< Function to get WebEngineCookieManager
221 };
222
223 } // unnamed namespace
224
225 WebEnginePtr WebEngine::New()
226 {
227   WebEngine* instance = new WebEngine();
228   if(!instance->Initialize())
229   {
230     delete instance;
231     return nullptr;
232   }
233
234   return instance;
235 }
236
237 Dali::WebEngineContext* WebEngine::GetContext()
238 {
239   if(!WebEnginePluginObject::GetInstance().InitializeContextHandle())
240   {
241     return nullptr;
242   }
243
244   if(WebEnginePluginObject::GetInstance().mGetWebEngineContextPtr)
245   {
246     return WebEnginePluginObject::GetInstance().mGetWebEngineContextPtr();
247   }
248
249   return nullptr;
250 }
251
252 Dali::WebEngineCookieManager* WebEngine::GetCookieManager()
253 {
254   if(!WebEnginePluginObject::GetInstance().InitializeCookieManagerHandle())
255   {
256     return nullptr;
257   }
258
259   if(WebEnginePluginObject::GetInstance().mGetWebEngineCookieManagerPtr)
260   {
261     return WebEnginePluginObject::GetInstance().mGetWebEngineCookieManagerPtr();
262   }
263
264   return nullptr;
265 }
266
267 WebEngine::WebEngine()
268 : mPlugin(nullptr)
269 {
270 }
271
272 WebEngine::~WebEngine()
273 {
274   if(mPlugin != nullptr)
275   {
276     mPlugin->Destroy();
277     // Check whether plugin load sccess or not.
278     if(DALI_LIKELY(WebEnginePluginObject::GetInstance()))
279     {
280       WebEnginePluginObject::GetInstance().mDestroyWebEnginePtr(mPlugin);
281     }
282     mPlugin = nullptr;
283   }
284 }
285
286 bool WebEngine::Initialize()
287 {
288   // Check whether plugin load sccess or not.
289   if(!WebEnginePluginObject::GetInstance())
290   {
291     return false;
292   }
293
294   mPlugin = WebEnginePluginObject::GetInstance().mCreateWebEnginePtr();
295   if(mPlugin == nullptr)
296   {
297     DALI_LOG_ERROR("Can't create the WebEnginePlugin object\n");
298     return false;
299   }
300   return true;
301 }
302
303 void WebEngine::Create(uint32_t width, uint32_t height, const std::string& locale, const std::string& timezoneId)
304 {
305   mPlugin->Create(width, height, locale, timezoneId);
306 }
307
308 void WebEngine::Create(uint32_t width, uint32_t height, uint32_t argc, char** argv)
309 {
310   mPlugin->Create(width, height, argc, argv);
311 }
312
313 void WebEngine::Destroy()
314 {
315   mPlugin->Destroy();
316 }
317
318 Dali::WebEnginePlugin* WebEngine::GetPlugin() const
319 {
320   return mPlugin;
321 }
322
323 Dali::NativeImageSourcePtr WebEngine::GetNativeImageSource()
324 {
325   return mPlugin->GetNativeImageSource();
326 }
327
328 Dali::WebEngineSettings& WebEngine::GetSettings() const
329 {
330   return mPlugin->GetSettings();
331 }
332
333 Dali::WebEngineBackForwardList& WebEngine::GetBackForwardList() const
334 {
335   return mPlugin->GetBackForwardList();
336 }
337
338 void WebEngine::LoadUrl(const std::string& url)
339 {
340   mPlugin->LoadUrl(url);
341 }
342
343 std::string WebEngine::GetTitle() const
344 {
345   return mPlugin->GetTitle();
346 }
347
348 Dali::PixelData WebEngine::GetFavicon() const
349 {
350   return mPlugin->GetFavicon();
351 }
352
353 std::string WebEngine::GetUrl() const
354 {
355   return mPlugin->GetUrl();
356 }
357
358 std::string WebEngine::GetUserAgent() const
359 {
360   return mPlugin->GetUserAgent();
361 }
362
363 void WebEngine::SetUserAgent(const std::string& userAgent)
364 {
365   mPlugin->SetUserAgent(userAgent);
366 }
367
368 void WebEngine::LoadHtmlString(const std::string& htmlString)
369 {
370   mPlugin->LoadHtmlString(htmlString);
371 }
372
373 bool WebEngine::LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl)
374 {
375   return mPlugin->LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl);
376 }
377
378 bool WebEngine::LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri)
379 {
380   return mPlugin->LoadContents(contents, contentSize, mimeType, encoding, baseUri);
381 }
382
383 void WebEngine::Reload()
384 {
385   mPlugin->Reload();
386 }
387
388 bool WebEngine::ReloadWithoutCache()
389 {
390   return mPlugin->ReloadWithoutCache();
391 }
392
393 void WebEngine::StopLoading()
394 {
395   mPlugin->StopLoading();
396 }
397
398 void WebEngine::Suspend()
399 {
400   mPlugin->Suspend();
401 }
402
403 void WebEngine::Resume()
404 {
405   mPlugin->Resume();
406 }
407
408 void WebEngine::SuspendNetworkLoading()
409 {
410   mPlugin->SuspendNetworkLoading();
411 }
412
413 void WebEngine::ResumeNetworkLoading()
414 {
415   mPlugin->ResumeNetworkLoading();
416 }
417
418 bool WebEngine::AddCustomHeader(const std::string& name, const std::string& value)
419 {
420   return mPlugin->AddCustomHeader(name, value);
421 }
422
423 bool WebEngine::RemoveCustomHeader(const std::string& name)
424 {
425   return mPlugin->RemoveCustomHeader(name);
426 }
427
428 uint32_t WebEngine::StartInspectorServer(uint32_t port)
429 {
430   return mPlugin->StartInspectorServer(port);
431 }
432
433 bool WebEngine::StopInspectorServer()
434 {
435   return mPlugin->StopInspectorServer();
436 }
437
438 void WebEngine::ScrollBy(int32_t deltaX, int32_t deltaY)
439 {
440   mPlugin->ScrollBy(deltaX, deltaY);
441 }
442
443 bool WebEngine::ScrollEdgeBy(int32_t deltaX, int32_t deltaY)
444 {
445   return mPlugin->ScrollEdgeBy(deltaX, deltaY);
446 }
447
448 void WebEngine::SetScrollPosition(int32_t x, int32_t y)
449 {
450   mPlugin->SetScrollPosition(x, y);
451 }
452
453 Dali::Vector2 WebEngine::GetScrollPosition() const
454 {
455   return mPlugin->GetScrollPosition();
456 }
457
458 Dali::Vector2 WebEngine::GetScrollSize() const
459 {
460   return mPlugin->GetScrollSize();
461 }
462
463 Dali::Vector2 WebEngine::GetContentSize() const
464 {
465   return mPlugin->GetContentSize();
466 }
467
468 void WebEngine::RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback)
469 {
470   mPlugin->RegisterJavaScriptAlertCallback(callback);
471 }
472
473 void WebEngine::JavaScriptAlertReply()
474 {
475   mPlugin->JavaScriptAlertReply();
476 }
477
478 void WebEngine::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback)
479 {
480   mPlugin->RegisterJavaScriptConfirmCallback(callback);
481 }
482
483 void WebEngine::JavaScriptConfirmReply(bool confirmed)
484 {
485   mPlugin->JavaScriptConfirmReply(confirmed);
486 }
487
488 void WebEngine::RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback)
489 {
490   mPlugin->RegisterJavaScriptPromptCallback(callback);
491 }
492
493 void WebEngine::JavaScriptPromptReply(const std::string& result)
494 {
495   mPlugin->JavaScriptPromptReply(result);
496 }
497
498 std::unique_ptr<Dali::WebEngineHitTest> WebEngine::CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode)
499 {
500   return mPlugin->CreateHitTest(x, y, mode);
501 }
502
503 bool WebEngine::CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, Dali::WebEnginePlugin::WebEngineHitTestCreatedCallback callback)
504 {
505   return mPlugin->CreateHitTestAsynchronously(x, y, mode, callback);
506 }
507
508 bool WebEngine::CanGoForward()
509 {
510   return mPlugin->CanGoForward();
511 }
512
513 void WebEngine::GoForward()
514 {
515   mPlugin->GoForward();
516 }
517
518 bool WebEngine::CanGoBack()
519 {
520   return mPlugin->CanGoBack();
521 }
522
523 void WebEngine::GoBack()
524 {
525   mPlugin->GoBack();
526 }
527
528 void WebEngine::EvaluateJavaScript(const std::string& script, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback resultHandler)
529 {
530   mPlugin->EvaluateJavaScript(script, resultHandler);
531 }
532
533 void WebEngine::AddJavaScriptMessageHandler(const std::string& exposedObjectName, Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback handler)
534 {
535   mPlugin->AddJavaScriptMessageHandler(exposedObjectName, handler);
536 }
537
538 void WebEngine::ClearAllTilesResources()
539 {
540   mPlugin->ClearAllTilesResources();
541 }
542
543 void WebEngine::ClearHistory()
544 {
545   mPlugin->ClearHistory();
546 }
547
548 void WebEngine::SetSize(uint32_t width, uint32_t height)
549 {
550   mPlugin->SetSize(width, height);
551 }
552
553 void WebEngine::EnableMouseEvents(bool enabled)
554 {
555   mPlugin->EnableMouseEvents(enabled);
556 }
557
558 void WebEngine::EnableKeyEvents(bool enabled)
559 {
560   mPlugin->EnableKeyEvents(enabled);
561 }
562
563 bool WebEngine::SendTouchEvent(const Dali::TouchEvent& touch)
564 {
565   return mPlugin->SendTouchEvent(touch);
566 }
567
568 bool WebEngine::SendKeyEvent(const Dali::KeyEvent& event)
569 {
570   return mPlugin->SendKeyEvent(event);
571 }
572
573 void WebEngine::SetFocus(bool focused)
574 {
575   mPlugin->SetFocus(focused);
576 }
577
578 void WebEngine::SetDocumentBackgroundColor(Dali::Vector4 color)
579 {
580   mPlugin->SetDocumentBackgroundColor(color);
581 }
582
583 void WebEngine::ClearTilesWhenHidden(bool cleared)
584 {
585   mPlugin->ClearTilesWhenHidden(cleared);
586 }
587
588 void WebEngine::SetTileCoverAreaMultiplier(float multiplier)
589 {
590   mPlugin->SetTileCoverAreaMultiplier(multiplier);
591 }
592
593 void WebEngine::EnableCursorByClient(bool enabled)
594 {
595   mPlugin->EnableCursorByClient(enabled);
596 }
597
598 std::string WebEngine::GetSelectedText() const
599 {
600   return mPlugin->GetSelectedText();
601 }
602
603 void WebEngine::SetPageZoomFactor(float zoomFactor)
604 {
605   mPlugin->SetPageZoomFactor(zoomFactor);
606 }
607
608 float WebEngine::GetPageZoomFactor() const
609 {
610   return mPlugin->GetPageZoomFactor();
611 }
612
613 void WebEngine::SetTextZoomFactor(float zoomFactor)
614 {
615   mPlugin->SetTextZoomFactor(zoomFactor);
616 }
617
618 float WebEngine::GetTextZoomFactor() const
619 {
620   return mPlugin->GetTextZoomFactor();
621 }
622
623 float WebEngine::GetLoadProgressPercentage() const
624 {
625   return mPlugin->GetLoadProgressPercentage();
626 }
627
628 void WebEngine::SetScaleFactor(float scaleFactor, Dali::Vector2 point)
629 {
630   mPlugin->SetScaleFactor(scaleFactor, point);
631 }
632
633 float WebEngine::GetScaleFactor() const
634 {
635   return mPlugin->GetScaleFactor();
636 }
637
638 void WebEngine::ActivateAccessibility(bool activated)
639 {
640   mPlugin->ActivateAccessibility(activated);
641 }
642
643 Accessibility::Address WebEngine::GetAccessibilityAddress()
644 {
645   return mPlugin->GetAccessibilityAddress();
646 }
647
648 bool WebEngine::SetVisibility(bool visible)
649 {
650   return mPlugin->SetVisibility(visible);
651 }
652
653 bool WebEngine::HighlightText(const std::string& text, Dali::WebEnginePlugin::FindOption options, uint32_t maxMatchCount)
654 {
655   return mPlugin->HighlightText(text, options, maxMatchCount);
656 }
657
658 void WebEngine::AddDynamicCertificatePath(const std::string& host, const std::string& certPath)
659 {
660   mPlugin->AddDynamicCertificatePath(host, certPath);
661 }
662
663 Dali::PixelData WebEngine::GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor)
664 {
665   return mPlugin->GetScreenshot(viewArea, scaleFactor);
666 }
667
668 bool WebEngine::GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, Dali::WebEnginePlugin::ScreenshotCapturedCallback callback)
669 {
670   return mPlugin->GetScreenshotAsynchronously(viewArea, scaleFactor, callback);
671 }
672
673 bool WebEngine::CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback)
674 {
675   return mPlugin->CheckVideoPlayingAsynchronously(callback);
676 }
677
678 void WebEngine::RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback)
679 {
680   mPlugin->RegisterGeolocationPermissionCallback(callback);
681 }
682
683 void WebEngine::UpdateDisplayArea(Dali::Rect<int32_t> displayArea)
684 {
685   mPlugin->UpdateDisplayArea(displayArea);
686 }
687
688 void WebEngine::EnableVideoHole(bool enabled)
689 {
690   mPlugin->EnableVideoHole(enabled);
691 }
692
693 bool WebEngine::SendHoverEvent(const Dali::HoverEvent& event)
694 {
695   return mPlugin->SendHoverEvent(event);
696 }
697
698 bool WebEngine::SendWheelEvent(const Dali::WheelEvent& event)
699 {
700   return mPlugin->SendWheelEvent(event);
701 }
702
703 Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
704 {
705   return mPlugin->FrameRenderedSignal();
706 }
707
708 void WebEngine::RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
709 {
710   mPlugin->RegisterPageLoadStartedCallback(callback);
711 }
712
713 void WebEngine::RegisterPageLoadInProgressCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
714 {
715   mPlugin->RegisterPageLoadInProgressCallback(callback);
716 }
717
718 void WebEngine::RegisterPageLoadFinishedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
719 {
720   mPlugin->RegisterPageLoadFinishedCallback(callback);
721 }
722
723 void WebEngine::RegisterPageLoadErrorCallback(Dali::WebEnginePlugin::WebEnginePageLoadErrorCallback callback)
724 {
725   mPlugin->RegisterPageLoadErrorCallback(callback);
726 }
727
728 void WebEngine::RegisterScrollEdgeReachedCallback(Dali::WebEnginePlugin::WebEngineScrollEdgeReachedCallback callback)
729 {
730   mPlugin->RegisterScrollEdgeReachedCallback(callback);
731 }
732
733 void WebEngine::RegisterUrlChangedCallback(Dali::WebEnginePlugin::WebEngineUrlChangedCallback callback)
734 {
735   mPlugin->RegisterUrlChangedCallback(callback);
736 }
737
738 void WebEngine::RegisterFormRepostDecidedCallback(Dali::WebEnginePlugin::WebEngineFormRepostDecidedCallback callback)
739 {
740   mPlugin->RegisterFormRepostDecidedCallback(callback);
741 }
742
743 void WebEngine::RegisterConsoleMessageReceivedCallback(Dali::WebEnginePlugin::WebEngineConsoleMessageReceivedCallback callback)
744 {
745   mPlugin->RegisterConsoleMessageReceivedCallback(callback);
746 }
747
748 void WebEngine::RegisterResponsePolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineResponsePolicyDecidedCallback callback)
749 {
750   mPlugin->RegisterResponsePolicyDecidedCallback(callback);
751 }
752
753 void WebEngine::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback)
754 {
755   mPlugin->RegisterNavigationPolicyDecidedCallback(callback);
756 }
757
758 void WebEngine::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
759 {
760   mPlugin->RegisterCertificateConfirmedCallback(callback);
761 }
762
763 void WebEngine::RegisterSslCertificateChangedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
764 {
765   mPlugin->RegisterSslCertificateChangedCallback(callback);
766 }
767
768 void WebEngine::RegisterHttpAuthHandlerCallback(Dali::WebEnginePlugin::WebEngineHttpAuthHandlerCallback callback)
769 {
770   mPlugin->RegisterHttpAuthHandlerCallback(callback);
771 }
772
773 void WebEngine::RegisterContextMenuShownCallback(Dali::WebEnginePlugin::WebEngineContextMenuShownCallback callback)
774 {
775   mPlugin->RegisterContextMenuShownCallback(callback);
776 }
777
778 void WebEngine::RegisterContextMenuHiddenCallback(Dali::WebEnginePlugin::WebEngineContextMenuHiddenCallback callback)
779 {
780   mPlugin->RegisterContextMenuHiddenCallback(callback);
781 }
782
783 void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
784 {
785   mPlugin->GetPlainTextAsynchronously(callback);
786 }
787
788 } // namespace Adaptor
789 } // namespace Internal
790 } // namespace Dali