From 168ca9403dfcf521f2692269b03174950ac6b333 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 14 Sep 2023 19:15:41 +0200 Subject: [PATCH] Return version information for wxWebViewChromium This can be useful for diagnostic purposes and looks better than "0.0" in the webview sample. Notice that currently we return the compile-time version and not the run-time version that could be retrieved using cef_version_info() because this is simpler and we shouldn't be ever using a different version from the one we were compiled with anyhow. --- samples/webview/webview.cpp | 2 +- src/common/webview_chromium.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/samples/webview/webview.cpp b/samples/webview/webview.cpp index 7c4e4d69ac..f43cebd248 100644 --- a/samples/webview/webview.cpp +++ b/samples/webview/webview.cpp @@ -483,7 +483,7 @@ WebFrame::WebFrame(const wxString& url, bool isMain, wxWebViewWindowFeatures* wi { // Log backend information wxLogMessage("Backend: %s Version: %s", m_browser->GetClassInfo()->GetClassName(), - wxWebView::GetBackendVersionInfo().ToString()); + wxWebView::GetBackendVersionInfo(backend).ToString()); // Chromium backend can't be used immediately after creation, so wait // until the browser is created before calling GetUserAgent(). diff --git a/src/common/webview_chromium.cpp b/src/common/webview_chromium.cpp index 894a72d201..b216a8fc2f 100644 --- a/src/common/webview_chromium.cpp +++ b/src/common/webview_chromium.cpp @@ -1475,6 +1475,18 @@ public: return true; } + + virtual wxVersionInfo GetVersionInfo() override + { + return { + "CEF", + CEF_VERSION_MAJOR, + CEF_VERSION_MINOR, + CEF_VERSION_PATCH, + CEF_COMMIT_NUMBER, + CEF_VERSION + }; + } }; class wxWebViewChromiumModule : public wxModule