From a5acf0f551763159ed79b63cb847cdb98fc950ef Mon Sep 17 00:00:00 2001 From: Matt Gajownik Date: Thu, 6 Feb 2025 23:26:33 +1100 Subject: [PATCH 1/2] Enable building with CEF 6834 OnBeforePopup gained a popup_id. No other changes required. --- browser-client.cpp | 10 +++++++--- browser-client.hpp | 3 +++ panel/browser-panel-client.cpp | 12 ++++++++---- panel/browser-panel-client.hpp | 3 +++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/browser-client.cpp b/browser-client.cpp index 951b4ac61..d9da7f728 100644 --- a/browser-client.cpp +++ b/browser-client.cpp @@ -99,9 +99,13 @@ CefResourceRequestHandler::ReturnValue BrowserClient::OnBeforeResourceLoad(CefRe } #endif -bool BrowserClient::OnBeforePopup(CefRefPtr, CefRefPtr, const CefString &, const CefString &, - cef_window_open_disposition_t, bool, const CefPopupFeatures &, CefWindowInfo &, - CefRefPtr &, CefBrowserSettings &, CefRefPtr &, bool *) +bool BrowserClient::OnBeforePopup(CefRefPtr, CefRefPtr, +#if CHROME_VERSION_BUILD >= 6834 + int, +#endif + const CefString &, const CefString &, cef_window_open_disposition_t, bool, + const CefPopupFeatures &, CefWindowInfo &, CefRefPtr &, + CefBrowserSettings &, CefRefPtr &, bool *) { /* block popups */ return true; diff --git a/browser-client.hpp b/browser-client.hpp index 051102c35..f29e3c69a 100644 --- a/browser-client.hpp +++ b/browser-client.hpp @@ -87,6 +87,9 @@ class BrowserClient : public CefClient, /* CefLifeSpanHandler */ virtual bool OnBeforePopup(CefRefPtr browser, CefRefPtr frame, +#if CHROME_VERSION_BUILD >= 6834 + int popup_id, +#endif const CefString &target_url, const CefString &target_frame_name, cef_window_open_disposition_t target_disposition, bool user_gesture, const CefPopupFeatures &popupFeatures, CefWindowInfo &windowInfo, diff --git a/panel/browser-panel-client.cpp b/panel/browser-panel-client.cpp index 22557bbfd..5bf281b12 100644 --- a/panel/browser-panel-client.cpp +++ b/panel/browser-panel-client.cpp @@ -172,10 +172,14 @@ void QCefBrowserClient::OnLoadError(CefRefPtr browser, CefRefPtr, CefRefPtr, const CefString &target_url, - const CefString &, CefLifeSpanHandler::WindowOpenDisposition, bool, - const CefPopupFeatures &, CefWindowInfo &windowInfo, CefRefPtr &, - CefBrowserSettings &, CefRefPtr &, bool *) +bool QCefBrowserClient::OnBeforePopup(CefRefPtr, CefRefPtr, +#if CHROME_VERSION_BUILD >= 6834 + int, +#endif + const CefString &target_url, const CefString &, + CefLifeSpanHandler::WindowOpenDisposition, bool, const CefPopupFeatures &, + CefWindowInfo &windowInfo, CefRefPtr &, CefBrowserSettings &, + CefRefPtr &, bool *) { if (allowAllPopups) { #ifdef _WIN32 diff --git a/panel/browser-panel-client.hpp b/panel/browser-panel-client.hpp index 43404c60b..417021fa9 100644 --- a/panel/browser-panel-client.hpp +++ b/panel/browser-panel-client.hpp @@ -51,6 +51,9 @@ class QCefBrowserClient : public CefClient, /* CefLifeSpanHandler */ virtual bool OnBeforePopup(CefRefPtr browser, CefRefPtr frame, +#if CHROME_VERSION_BUILD >= 6834 + int popup_id, +#endif const CefString &target_url, const CefString &target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures &popupFeatures, CefWindowInfo &windowInfo, From 35d7c1bd241a976baef679b8a33ef4fd0cac77fb Mon Sep 17 00:00:00 2001 From: Matt Gajownik Date: Fri, 7 Feb 2025 18:15:00 +1100 Subject: [PATCH 2/2] Enable building with CEF 6943 The cef_version_info function was moved out into its own file in 6943 in preparation for official CEF API versioning. https://bitbucket.org/chromiumembedded/cef/wiki/ApiVersioning Additionally, a new VType was added on non-Windows platforms, and while it'll never be returned the build will error if it's unhandled. --- browser-app.cpp | 5 +++++ cef-headers.hpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/browser-app.cpp b/browser-app.cpp index 61ee6a590..7a6c893a9 100644 --- a/browser-app.cpp +++ b/browser-app.cpp @@ -276,6 +276,11 @@ CefRefPtr CefValueToCefV8Value(CefRefPtr value) result->SetValue((int)i, CefValueToCefV8Value(list->GetValue(i))); } } break; +#if !defined(_WIN32) && CHROME_VERSION_BUILD >= 6943 + case VTYPE_NUM_VALUES: + result = CefV8Value::CreateNull(); + break; +#endif } return result; } diff --git a/cef-headers.hpp b/cef-headers.hpp index 8cc8b667d..8786f98e9 100644 --- a/cef-headers.hpp +++ b/cef-headers.hpp @@ -34,6 +34,9 @@ #include #include #include +#if CHROME_VERSION_BUILD >= 6943 +#include +#endif #include #include #include