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.
This commit is contained in:
Vadim Zeitlin 2023-09-14 19:15:41 +02:00
parent 05a8dfa555
commit 168ca9403d
2 changed files with 13 additions and 1 deletions

View file

@ -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().

View file

@ -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