MCPcopy Create free account
hub / github.com/axmolengine/axmol / WebViewImpl

Method WebViewImpl

core/ui/UIWebView/UIWebViewImpl-linux.cpp:703–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701{
702
703WebViewImpl::WebViewImpl(WebView* webView) : _createSucceeded(false), _gtkWebKit(nullptr), _webView(webView)
704{
705 _gtkWebKit = new GTKWebKit();
706 _createSucceeded = _gtkWebKit->createWebView(
707 [this](std::string_view url) -> bool {
708 const auto shouldStartLoading = _webView->getOnShouldStartLoading();
709 if (shouldStartLoading != nullptr)
710 {
711 return shouldStartLoading(_webView, url);
712 }
713 return true;
714 },
715 [this](std::string_view url) {
716 WebView::ccWebViewCallback didFinishLoading = _webView->getOnDidFinishLoading();
717 if (didFinishLoading != nullptr)
718 {
719 didFinishLoading(_webView, url);
720 }
721 },
722 [this](std::string_view url) {
723 WebView::ccWebViewCallback didFailLoading = _webView->getOnDidFailLoading();
724 if (didFailLoading != nullptr)
725 {
726 didFailLoading(_webView, url);
727 }
728 },
729 [this](std::string_view url) {
730 WebView::ccWebViewCallback onJsCallback = _webView->getOnJSCallback();
731 if (onJsCallback != nullptr)
732 {
733 onJsCallback(_webView, url);
734 }
735 });
736}
737
738WebViewImpl::~WebViewImpl()
739{

Callers

nothing calls this directly

Calls 5

getOnDidFinishLoadingMethod · 0.80
getOnDidFailLoadingMethod · 0.80
getOnJSCallbackMethod · 0.80
createWebViewMethod · 0.45

Tested by

no test coverage detected