diff --git a/CMakeLists.txt b/CMakeLists.txt index 58a0a32..1d3c973 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,23 +96,29 @@ configure_file( message(STATUS "Detecting CEF_SDK_VERSION: ${CEF_SDK_VERSION}") if(NOT CEF_SDK_VERSION) - # "89.0.12+g2b76680+chromium-89.0.4389.90" # GOOD - # "91.1.23+g04c8d56+chromium-91.0.4472.164" # GOOD - # "95.7.12+g99c4ac0+chromium-95.0.4638.54" # GOOD - # "99.2.15+g71e9523+chromium-99.0.4844.84" # GOOD - # "102.0.10+gf249b2e+chromium-102.0.5005.115" # GOOD - # "104.4.18+g2587cf2+chromium-104.0.5112.81" # BAD # crash on macOS - debug mode - # "104.4.26+g4180781+chromium-104.0.5112.102" # BAD # crash on macOS - debug mode - # "105.3.25+g0ca6a9e+chromium-105.0.5195.54" # BAD # debugbreak - debug mode - # "105.3.28+g002805e+chromium-105.0.5195.54" # BAD # debugbreak - debug mode - # "107.1.9+g1f0a21a+chromium-107.0.5304.110" # BAD # debugbreak - debug mode - # "110.0.26+g732747f+chromium-110.0.5481.97" # BAD # TO-BE-FIXED - # "113.3.1+g525fa10+chromium-113.0.5672.128" # GOOD - # "119.4.4+g5d1e039+chromium-119.0.6045.199" # GOOD - # "120.1.6+gf08b1fd+chromium-120.0.6099.71" # GOOD - # "121.3.15+g4d3b0b4+chromium-121.0.6167.184" # GOOD - # "122.1.7+gdd187af+chromium-122.0.6261.29" - set(DEFAULT_CEF_SDK_VER "119.4.4+g5d1e039+chromium-119.0.6045.199") + # set(DEFAULT_CEF_SDK_VER "89.0.12+g2b76680+chromium-89.0.4389.90") # GOOD + # set(DEFAULT_CEF_SDK_VER "91.1.23+g04c8d56+chromium-91.0.4472.164") # GOOD + # set(DEFAULT_CEF_SDK_VER "95.7.12+g99c4ac0+chromium-95.0.4638.54") # GOOD + # set(DEFAULT_CEF_SDK_VER "99.2.15+g71e9523+chromium-99.0.4844.84") # GOOD + # set(DEFAULT_CEF_SDK_VER "102.0.10+gf249b2e+chromium-102.0.5005.115") # GOOD + # set(DEFAULT_CEF_SDK_VER "104.4.18+g2587cf2+chromium-104.0.5112.81") # BAD # crash on macOS - debug mode + # set(DEFAULT_CEF_SDK_VER "104.4.26+g4180781+chromium-104.0.5112.102") # BAD # crash on macOS - debug mode + # set(DEFAULT_CEF_SDK_VER "105.3.25+g0ca6a9e+chromium-105.0.5195.54") # BAD # debugbreak - debug mode + # set(DEFAULT_CEF_SDK_VER "105.3.28+g002805e+chromium-105.0.5195.54") # BAD # debugbreak - debug mode + # set(DEFAULT_CEF_SDK_VER "107.1.9+g1f0a21a+chromium-107.0.5304.110") # BAD # debugbreak - debug mode + # set(DEFAULT_CEF_SDK_VER "110.0.26+g732747f+chromium-110.0.5481.97") # BAD # TO-BE-FIXED + # set(DEFAULT_CEF_SDK_VER "113.3.1+g525fa10+chromium-113.0.5672.128") # GOOD + # set(DEFAULT_CEF_SDK_VER "119.4.4+g5d1e039+chromium-119.0.6045.199") # GOOD + # set(DEFAULT_CEF_SDK_VER "120.1.6+gf08b1fd+chromium-120.0.6099.71") # GOOD + # set(DEFAULT_CEF_SDK_VER "121.3.15+g4d3b0b4+chromium-121.0.6167.184") # GOOD + # set(DEFAULT_CEF_SDK_VER "122.1.13+gde5b724+chromium-122.0.6261.130") # NOT-TEST + # set(DEFAULT_CEF_SDK_VER "123.0.13+gfc703fb+chromium-123.0.6312.124") # NOT-TEST + # set(DEFAULT_CEF_SDK_VER "124.3.9+g9bd638f+chromium-124.0.6367.207") # NOT-TEST + # set(DEFAULT_CEF_SDK_VER "125.0.22+gc410c95+chromium-125.0.6422.142") # NOT-TEST + # set(DEFAULT_CEF_SDK_VER "126.2.18+g3647d39+chromium-126.0.6478.183") # NOT-TEST + set(DEFAULT_CEF_SDK_VER "127.3.5+g114ea2a+chromium-127.0.6533.120") # GOOD + + # set(DEFAULT_CEF_SDK_VER "128.4.9+g9840ad9+chromium-128.0.6613.120") # BAD # debugbreak - debug mode message(STATUS "CEF_SDK_VERSION is empty, use default version ${DEFAULT_CEF_SDK_VER}\n" "You can change the version by adding -DCEF_SDK_VERSION=xxx to commandline for generation") diff --git a/include/CefViewBrowserClient.h b/include/CefViewBrowserClient.h index d2ccb29..01156b5 100644 --- a/include/CefViewBrowserClient.h +++ b/include/CefViewBrowserClient.h @@ -195,15 +195,33 @@ class CefViewBrowserClient // CefDialogHandler #pragma region CefDialogHandler virtual CefRefPtr GetDialogHandler() override; + +#if CEF_VERSION_MAJOR < 102 virtual bool OnFileDialog(CefRefPtr browser, FileDialogMode mode, const CefString& title, const CefString& default_file_path, const std::vector& accept_filters, -#if CEF_VERSION_MAJOR < 102 int selected_accept_filter, -#endif CefRefPtr callback) override; +#elif CEF_VERSION_MAJOR < 126 + virtual bool OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + CefRefPtr callback) override; +#else + virtual bool OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + const std::vector& accept_extensions, + const std::vector& accept_descriptions, + CefRefPtr callback) override; +#endif + #pragma endregion // CefDisplayHandler methods @@ -231,10 +249,17 @@ class CefViewBrowserClient // CefDownloadHandler #pragma region CefDownloadHandler virtual CefRefPtr GetDownloadHandler() override; - void OnBeforeDownload(CefRefPtr browser, + #if CEF_VERSION_MAJOR < 125 + virtual void OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, const CefString& suggested_name, CefRefPtr callback) override; + #else + virtual bool OnBeforeDownload(CefRefPtr browser, + CefRefPtr download_item, + const CefString& suggested_name, + CefRefPtr callback) override; + #endif void OnDownloadUpdated(CefRefPtr browser, CefRefPtr download_item, @@ -343,10 +368,17 @@ class CefViewBrowserClient const void* buffer, int width, int height) override; +#if CEF_VERSION_MAJOR < 124 virtual void OnAcceleratedPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, void* shared_handle) override; +#else + virtual void OnAcceleratedPaint(CefRefPtr browser, + PaintElementType type, + const RectList& dirtyRects, + const CefAcceleratedPaintInfo& info) override; +#endif virtual bool StartDragging(CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, @@ -384,7 +416,15 @@ class CefViewBrowserClient CefRefPtr callback) override; #endif +#if CEF_VERSION_MAJOR < 124 virtual void OnRenderProcessTerminated(CefRefPtr browser, TerminationStatus status) override; +#else + virtual void OnRenderProcessTerminated(CefRefPtr browser, + TerminationStatus status, + int error_code, + const CefString& error_string) override; +#endif + #pragma endregion // CefResourceRequestHandler diff --git a/include/CefViewBrowserClientDelegate.h b/include/CefViewBrowserClientDelegate.h index 3dd3c99..e7f7792 100644 --- a/include/CefViewBrowserClientDelegate.h +++ b/include/CefViewBrowserClientDelegate.h @@ -209,12 +209,21 @@ class CefViewBrowserClientDelegateInterface int height) { } +#if CEF_VERSION_MAJOR < 124 virtual void onAcceleratedPaint(CefRefPtr browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList& dirtyRects, void* shared_handle) { } + #else + virtual void onAcceleratedPaint(CefRefPtr browser, + CefRenderHandler::PaintElementType type, + const CefRenderHandler::RectList& dirtyRects, + const CefAcceleratedPaintInfo& info) + { + } + #endif virtual bool startDragging(CefRefPtr browser, CefRefPtr drag_data, CefRenderHandler::DragOperationsMask allowed_ops, diff --git a/include/CefViewCoreGlobal.h b/include/CefViewCoreGlobal.h index b6974b5..c290e89 100644 --- a/include/CefViewCoreGlobal.h +++ b/include/CefViewCoreGlobal.h @@ -3,7 +3,6 @@ * Project: include * Created: 30 May 2023 * Author: Sheen Tian - * This file was generated by CMake, do not modify this manually */ #ifndef CefViewCoreGlobal_h #define CefViewCoreGlobal_h diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient_DialogHandler.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient_DialogHandler.cpp index 953543b..3243273 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient_DialogHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient_DialogHandler.cpp @@ -18,16 +18,34 @@ CefViewBrowserClient::GetDialogHandler() return this; } +#if CEF_VERSION_MAJOR < 102 bool CefViewBrowserClient::OnFileDialog(CefRefPtr browser, - FileDialogMode mode, - const CefString& title, - const CefString& default_file_path, - const std::vector& accept_filters, -#if CEF_VERSION_MAJOR < 102 - int selected_accept_filter, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + int selected_accept_filter, + CefRefPtr callback) +#elif CEF_VERSION_MAJOR < 126 +bool +CefViewBrowserClient::OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + CefRefPtr callback) +#else +bool +CefViewBrowserClient::OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + const std::vector& accept_extensions, + const std::vector& accept_descriptions, + CefRefPtr callback) #endif - CefRefPtr callback) { auto delegate = client_delegate_.lock(); if (delegate) diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient_DownloadHandler.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient_DownloadHandler.cpp index 0d54079..fc8ca79 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient_DownloadHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient_DownloadHandler.cpp @@ -14,6 +14,7 @@ CefViewBrowserClient::GetDownloadHandler() return this; } +#if CEF_VERSION_MAJOR < 125 void CefViewBrowserClient::OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, @@ -26,6 +27,22 @@ CefViewBrowserClient::OnBeforeDownload(CefRefPtr browser, if (delegate) delegate->onBeforeDownload(browser, download_item, suggested_name, callback); } +#else +bool +CefViewBrowserClient::OnBeforeDownload(CefRefPtr browser, + CefRefPtr download_item, + const CefString& suggested_name, + CefRefPtr callback) +{ + CEF_REQUIRE_UI_THREAD(); + + auto delegate = client_delegate_.lock(); + if (delegate) + delegate->onBeforeDownload(browser, download_item, suggested_name, callback); + + return false; +} +#endif void CefViewBrowserClient::OnDownloadUpdated(CefRefPtr browser, diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient_RenderHandler.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient_RenderHandler.cpp index 4d58e28..3959a78 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient_RenderHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient_RenderHandler.cpp @@ -90,6 +90,7 @@ CefViewBrowserClient::OnPaint(CefRefPtr browser, return delegate->onPaint(browser, type, dirtyRects, buffer, width, height); } +#if CEF_VERSION_MAJOR < 124 void CefViewBrowserClient::OnAcceleratedPaint(CefRefPtr browser, PaintElementType type, @@ -100,6 +101,19 @@ CefViewBrowserClient::OnAcceleratedPaint(CefRefPtr browser, if (delegate) delegate->onAcceleratedPaint(browser, type, dirtyRects, shared_handle); } +#else + +void +CefViewBrowserClient::OnAcceleratedPaint(CefRefPtr browser, + PaintElementType type, + const RectList& dirtyRects, + const CefAcceleratedPaintInfo& info) +{ + auto delegate = client_delegate_.lock(); + if (delegate) + delegate->onAcceleratedPaint(browser, type, dirtyRects, info); +} +#endif bool CefViewBrowserClient::StartDragging(CefRefPtr browser, diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient_RequestHandler.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient_RequestHandler.cpp index d82d1c7..256fb32 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient_RequestHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient_RequestHandler.cpp @@ -61,8 +61,16 @@ CefViewBrowserClient::OnQuotaRequest(CefRefPtr browser, } #endif +#if CEF_VERSION_MAJOR < 124 void CefViewBrowserClient::OnRenderProcessTerminated(CefRefPtr browser, TerminationStatus status) +#else +void +CefViewBrowserClient::OnRenderProcessTerminated(CefRefPtr browser, + TerminationStatus status, + int error_code, + const CefString& error_string) +#endif { CEF_REQUIRE_UI_THREAD();