diff --git a/CMakeLists.txt b/CMakeLists.txt index 55adc3a..1eea1af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ if(NOT CEFVIEW_WING_NAME) endif() configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/include/CefViewCoreProtocol.h.in" + "${CMAKE_CURRENT_SOURCE_DIR}/src/CefViewCoreProtocol.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/include/CefViewCoreProtocol.h" @ONLY ) @@ -145,53 +145,8 @@ if(NOT CEF_SDK_VERSION) set(CEF_SDK_VERSION ${DEFAULT_CEF_SDK_VERSION} CACHE STRING "Cef binary SDK version" FORCE) endif() -include(DownloadCef) - -if(${CMAKE_VERSION} GREATER "3.11") - cmake_policy(SET CMP0074 NEW) -endif() - -if(${CMAKE_VERSION} GREATER "3.12") - cmake_policy(SET CMP0077 NEW) -endif() - -if(OS_WINDOWS) - add_link_options(/DEBUG) - - if(USE_SANDBOX) - # cef_sandbox.lib is MT already, must keep the same with it - set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Use static runtime") - add_compile_options("/MT$<$:d>") - else() - # either MT or MD is supported - set(CEF_RUNTIME_LIBRARY_FLAG "/M$,T,D>" CACHE STRING "Use static runtime" FORCE) - add_compile_options("/M$,T,D>$<$:d>") - endif() -else() - add_compile_options( - "-g" - "$<$:-O0>" - "$<$:-O3>" - ) -endif() - -# Append CEF root dir to CMAKE_MODULE_PATH -set(CEF_ROOT "${CEF_SDK_DIR}") -list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake") -find_package(CEF REQUIRED) - -# Add libcef dll wrapper -add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper) - -if(USE_SANDBOX AND(OS_WINDOWS OR OS_MACOS)) - add_definitions(-DCEF_USE_SANDBOX) - - # message(STATUS "cef_sandbox_lib path:" "${CEF_SANDBOX_LIB_DEBUG}," "${CEF_SANDBOX_LIB_RELEASE}" ) - # Logical target used to link the cef_sandbox library. - ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") -endif() - -PRINT_CEF_CONFIG() +# setup CEF +include(SetupCef) # ############################################################## set(CMAKE_SUPPRESS_REGENERATION TRUE) @@ -230,3 +185,20 @@ if(IS_CURRENT_IN_SUBDIRECTORY) set(CefViewCore_CEF_RESOURCE_DIR ${CEF_RESOURCE_DIR} PARENT_SCOPE) set(CefViewCore_CEF_INCLUDE_DIR ${CEF_ROOT}/include PARENT_SCOPE) endif() + +install( + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/output/$/lib" + DESTINATION "$" +) +install( + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/output/$/bin" + DESTINATION "$" +) +install( + DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" + DESTINATION "include/CefViewCore" +) +install( + DIRECTORY "${CEF_SDK_DIR}/include" + DESTINATION "include/cef" +) diff --git a/cmake/DownloadCef.cmake b/cmake/DownloadCef.cmake deleted file mode 100644 index 0d2d538..0000000 --- a/cmake/DownloadCef.cmake +++ /dev/null @@ -1,90 +0,0 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# Generally, there is NO NEED to modify the following config -# -# Download CEF binary package -# https://cef-builds.spotifycdn.com/index.html -# -if(NOT CEF_SDK_VERSION) - message(FATAL_ERROR "CEF_SDK_VERSION is missing!") -endif() - -if(OS_WINDOWS) - set(CEF_SDK_PLATFORM "windows") -elseif(OS_LINUX) - set(CEF_SDK_PLATFORM "linux") -elseif(OS_MACOS) - set(CEF_SDK_PLATFORM "macos") -else() - message(FATAL_ERROR "Unsupported Operating System") -endif() - -if(PROJECT_ARCH STREQUAL "x86_64") - set(CEF_SDK_ARCH "64") -elseif(PROJECT_ARCH STREQUAL "x86") - set(CEF_SDK_ARCH "32") -elseif(PROJECT_ARCH STREQUAL "arm64") - set(CEF_SDK_ARCH "arm64") -elseif(PROJECT_ARCH STREQUAL "arm") - set(CEF_SDK_ARCH "arm") -else() - message(FATAL_ERROR "Unsupported Processor Architecture") -endif() - -# set cef sdk package name -set(CEF_SDK_WORKSPACE "${CMAKE_CURRENT_SOURCE_DIR}/dep") - -if(OS_MACOS AND PROJECT_ARCH STREQUAL "x86_64") - # macosx64 - set(CEF_SDK_PACKAGE_NAME "cef_binary_${CEF_SDK_VERSION}_${CEF_SDK_PLATFORM}x${CEF_SDK_ARCH}") -else() - set(CEF_SDK_PACKAGE_NAME "cef_binary_${CEF_SDK_VERSION}_${CEF_SDK_PLATFORM}${CEF_SDK_ARCH}") -endif() - -if(NOT CUSTOM_CEF_SDK_DIR) - # Scan extracted sdk dir - set(CEF_SDK_EXTRACTED_DIR "${CEF_SDK_WORKSPACE}/${CEF_SDK_PACKAGE_NAME}") - file(GLOB CEF_SDK_DIR "${CEF_SDK_EXTRACTED_DIR}") -else() - message("Custom Cef path: ${CUSTOM_CEF_SDK_DIR}") - set(CEF_SDK_DIR "${CUSTOM_CEF_SDK_DIR}") -endif() - -# Extract CEF binary package -if(NOT EXISTS ${CEF_SDK_DIR}) - set(CEF_LOCAL_PACKAGE_PATH "${CEF_SDK_WORKSPACE}/${CEF_SDK_PACKAGE_NAME}.tar.bz2") - - # if no local cef sdk package file then download it - if(NOT EXISTS "${CEF_LOCAL_PACKAGE_PATH}") - set(CEF_SDK_DOWNLOAD_URL "https://cef-builds.spotifycdn.com/${CEF_SDK_PACKAGE_NAME}.tar.bz2") - message(STATUS "Downloading CEF binary SDK from ${CEF_SDK_DOWNLOAD_URL}") - file(DOWNLOAD - "${CEF_SDK_DOWNLOAD_URL}" # URL - "${CEF_LOCAL_PACKAGE_PATH}" # Local Path - SHOW_PROGRESS - TLS_VERIFY ON - STATUS DOWNLOAD_RESULT - ) - list(GET DOWNLOAD_RESULT 0 DOWNLOAD_RESULT_CODE) - list(GET DOWNLOAD_RESULT 1 DOWNLOAD_RESULT_MESSAGE) - - if(NOT DOWNLOAD_RESULT_CODE EQUAL 0) - file(REMOVE "${CEF_LOCAL_PACKAGE_PATH}") - message(FATAL_ERROR "Failed to download CEF binary SDK, ERROR:[${DOWNLOAD_RESULT_CODE}]${DOWNLOAD_RESULT_MESSAGE}") - endif() - endif() - - message(STATUS "Extracting CEF binary SDK from ${CEF_LOCAL_PACKAGE_PATH}") - - # Extract - file(ARCHIVE_EXTRACT - INPUT "${CEF_LOCAL_PACKAGE_PATH}" - DESTINATION "${CEF_SDK_WORKSPACE}" - VERBOSE - ) - - # Capture the dir name - file(GLOB CEF_SDK_DIR "${CEF_SDK_EXTRACTED_DIR}") -endif() - -# output -message(STATUS "CEF SDK dir: ${CEF_SDK_DIR}") diff --git a/cmake/SetupCef.cmake b/cmake/SetupCef.cmake new file mode 100644 index 0000000..9e472e4 --- /dev/null +++ b/cmake/SetupCef.cmake @@ -0,0 +1,232 @@ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# Generally, there is NO NEED to modify the following config +# +# Download CEF binary package +# https://cef-builds.spotifycdn.com/index.html +# + +# ################################################################################# +# Stage 1. Download CEF binary package +if(NOT CEF_SDK_VERSION) + message(FATAL_ERROR "CEF_SDK_VERSION is missing!") +endif() + +if(OS_WINDOWS) + set(CEF_SDK_PLATFORM "windows") +elseif(OS_LINUX) + set(CEF_SDK_PLATFORM "linux") +elseif(OS_MACOS) + set(CEF_SDK_PLATFORM "macos") +else() + message(FATAL_ERROR "Unsupported Operating System") +endif() + +if(PROJECT_ARCH STREQUAL "x86_64") + set(CEF_SDK_ARCH "64") +elseif(PROJECT_ARCH STREQUAL "x86") + set(CEF_SDK_ARCH "32") +elseif(PROJECT_ARCH STREQUAL "arm64") + set(CEF_SDK_ARCH "arm64") +elseif(PROJECT_ARCH STREQUAL "arm") + set(CEF_SDK_ARCH "arm") +else() + message(FATAL_ERROR "Unsupported Processor Architecture") +endif() + +# set cef sdk package name +set(CEF_SDK_WORKSPACE "${CMAKE_CURRENT_SOURCE_DIR}/dep") + +if(OS_MACOS AND PROJECT_ARCH STREQUAL "x86_64") + # macosx64 + set(CEF_SDK_PACKAGE_NAME "cef_binary_${CEF_SDK_VERSION}_${CEF_SDK_PLATFORM}x${CEF_SDK_ARCH}") +else() + set(CEF_SDK_PACKAGE_NAME "cef_binary_${CEF_SDK_VERSION}_${CEF_SDK_PLATFORM}${CEF_SDK_ARCH}") +endif() + +if(NOT CUSTOM_CEF_SDK_DIR) + # Scan extracted sdk dir + set(CEF_SDK_EXTRACTED_DIR "${CEF_SDK_WORKSPACE}/${CEF_SDK_PACKAGE_NAME}") + file(GLOB CEF_SDK_DIR "${CEF_SDK_EXTRACTED_DIR}") +else() + message("Custom Cef path: ${CUSTOM_CEF_SDK_DIR}") + set(CEF_SDK_DIR "${CUSTOM_CEF_SDK_DIR}") +endif() + +# output +message(STATUS "CEF SDK dir: ${CEF_SDK_DIR}") + +# ################################################################################# +# Stage 2. Extract CEF binary package +if(NOT EXISTS ${CEF_SDK_DIR}) + set(CEF_LOCAL_PACKAGE_PATH "${CEF_SDK_WORKSPACE}/${CEF_SDK_PACKAGE_NAME}.tar.bz2") + + # if no local cef sdk package file then download it + if(NOT EXISTS "${CEF_LOCAL_PACKAGE_PATH}") + set(CEF_SDK_DOWNLOAD_URL "https://cef-builds.spotifycdn.com/${CEF_SDK_PACKAGE_NAME}.tar.bz2") + message(STATUS "Downloading CEF binary SDK from ${CEF_SDK_DOWNLOAD_URL}") + file(DOWNLOAD + "${CEF_SDK_DOWNLOAD_URL}" # URL + "${CEF_LOCAL_PACKAGE_PATH}" # Local Path + SHOW_PROGRESS + TLS_VERIFY ON + STATUS DOWNLOAD_RESULT + ) + list(GET DOWNLOAD_RESULT 0 DOWNLOAD_RESULT_CODE) + list(GET DOWNLOAD_RESULT 1 DOWNLOAD_RESULT_MESSAGE) + + if(NOT DOWNLOAD_RESULT_CODE EQUAL 0) + file(REMOVE "${CEF_LOCAL_PACKAGE_PATH}") + message(FATAL_ERROR "Failed to download CEF binary SDK, ERROR:[${DOWNLOAD_RESULT_CODE}]${DOWNLOAD_RESULT_MESSAGE}") + endif() + endif() + + message(STATUS "Extracting CEF binary SDK from ${CEF_LOCAL_PACKAGE_PATH}") + + # Extract + file(ARCHIVE_EXTRACT + INPUT "${CEF_LOCAL_PACKAGE_PATH}" + DESTINATION "${CEF_SDK_WORKSPACE}" + VERBOSE + ) + + # Capture the dir name + file(GLOB CEF_SDK_DIR "${CEF_SDK_EXTRACTED_DIR}") +endif() + +# ################################################################################# +# Stage 3. Config CEF +if(${CMAKE_VERSION} GREATER "3.11") + cmake_policy(SET CMP0074 NEW) +endif() + +if(${CMAKE_VERSION} GREATER "3.12") + cmake_policy(SET CMP0077 NEW) +endif() + +if(OS_WINDOWS) + add_link_options(/DEBUG) + + if(USE_SANDBOX) + # cef_sandbox.lib is MT already, must keep the same with it + set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Use static runtime") + add_compile_options("/MT$<$:d>") + else() + # either MT or MD is supported + set(CEF_RUNTIME_LIBRARY_FLAG "/M$,T,D>" CACHE STRING "Use static runtime" FORCE) + add_compile_options("/M$,T,D>$<$:d>") + endif() +else() + add_compile_options( + "-g" + "$<$:-O0>" + "$<$:-O3>" + ) +endif() + +# Append CEF root dir to CMAKE_MODULE_PATH +set(CEF_ROOT "${CEF_SDK_DIR}") +list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake") +find_package(CEF REQUIRED) + +# Add libcef dll wrapper +add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper) + +if(USE_SANDBOX AND(OS_WINDOWS OR OS_MACOS)) + add_definitions(-DCEF_USE_SANDBOX) + + # message(STATUS "cef_sandbox_lib path:" "${CEF_SANDBOX_LIB_DEBUG}," "${CEF_SANDBOX_LIB_RELEASE}" ) + # Logical target used to link the cef_sandbox library. + ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") +endif() + +PRINT_CEF_CONFIG() + +# ################################################################################# +# Stage 4. Read CEF version and generated CefVersion.h +# set need configure QCefView_global to false +set(Need_Config_CefVersion_File FALSE) + +message(STATUS "${CEF_ROOT}/include/cef_version.h") +file(READ "${CEF_ROOT}/include/cef_version.h" cef_version_content) + +# ------------ check CEF_VERSION +string(REGEX MATCH "#define CEF_VERSION \"([a-z0-9\.\+\-]+)\"" _ ${cef_version_content}) + +if(NOT "${CMAKE_MATCH_1}" STREQUAL "${CEF_VERSION}") + set(CEF_VERSION ${CMAKE_MATCH_1} CACHE STRING "CEF Version" FORCE) + set(Need_Config_CefVersion_File TRUE) + message(STATUS "CEF_VERSION: ${CEF_VERSION} - Updated!") +else() + message(STATUS "CEF_VERSION: ${CEF_VERSION} - No Change!") +endif() + +# ------------ check CEF_VERSION_MAJOR +string(REGEX MATCH "#define CEF_VERSION_MAJOR ([0-9]+)" _ ${cef_version_content}) + +if(NOT "${CMAKE_MATCH_1}" STREQUAL "${CEF_VERSION_MAJOR}") + set(CEF_VERSION_MAJOR ${CMAKE_MATCH_1} CACHE STRING "CEF Major Version" FORCE) + set(Need_Config_CefVersion_File TRUE) + message(STATUS "CEF_VERSION_MAJOR: ${CEF_VERSION_MAJOR} - Updated!") +else() + message(STATUS "CEF_VERSION_MAJOR: ${CEF_VERSION_MAJOR} - No Change!") +endif() + +# ------------ check CEF_VERSION_MINOR +string(REGEX MATCH "#define CEF_VERSION_MINOR ([0-9]+)" _ ${cef_version_content}) + +if(NOT "${CMAKE_MATCH_1}" STREQUAL "${CEF_VERSION_MINOR}") + set(CEF_VERSION_MINOR ${CMAKE_MATCH_1} CACHE STRING "CEF Minor Version" FORCE) + set(Need_Config_CefVersion_File TRUE) + message(STATUS "CEF_VERSION_MINOR: ${CEF_VERSION_MINOR} - Updated!") +else() + message(STATUS "CEF_VERSION_MINOR: ${CEF_VERSION_MINOR} - No Change!") +endif() + +# ------------ check CEF_VERSION_PATCH +string(REGEX MATCH "#define CEF_VERSION_PATCH ([0-9]+)" _ ${cef_version_content}) + +if(NOT "${CMAKE_MATCH_1}" STREQUAL "${CEF_VERSION_PATCH}") + set(CEF_VERSION_PATCH ${CMAKE_MATCH_1} CACHE STRING "CEF Patch Version" FORCE) + set(Need_Config_CefVersion_File TRUE) + message(STATUS "CEF_VERSION_PATCH: ${CEF_VERSION_PATCH} - Updated!") +else() + message(STATUS "CEF_VERSION_PATCH: ${CEF_VERSION_PATCH} - No Change!") +endif() + +# ------------ check CEF_COMMIT_NUMBER +string(REGEX MATCH "#define CEF_COMMIT_NUMBER ([0-9]+)" _ ${cef_version_content}) + +if(NOT "${CMAKE_MATCH_1}" STREQUAL "${CEF_COMMIT_NUMBER}") + set(CEF_COMMIT_NUMBER ${CMAKE_MATCH_1} CACHE STRING "CEF Commit Number" FORCE) + set(Need_Config_CefVersion_File TRUE) + message(STATUS "CEF_COMMIT_NUMBER: ${CEF_COMMIT_NUMBER} - Updated!") +else() + message(STATUS "CEF_COMMIT_NUMBER: ${CEF_COMMIT_NUMBER} - No Change!") +endif() + +# ------------ check CEF_COMMIT_HASH +string(REGEX MATCH "#define CEF_COMMIT_HASH \"([a-z0-9]+)\"" _ ${cef_version_content}) + +if(NOT "${CMAKE_MATCH_1}" STREQUAL "${CEF_COMMIT_HASH}") + set(CEF_COMMIT_HASH ${CMAKE_MATCH_1} CACHE STRING "CEF Commit Hash" FORCE) + set(Need_Config_CefVersion_File TRUE) + message(STATUS "CEF_COMMIT_HASH: ${CEF_COMMIT_HASH} - Updated!") +else() + message(STATUS "CEF_COMMIT_HASH: ${CEF_COMMIT_HASH} - No Change!") +endif() + +if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/CefVersion.h") + set(Need_Config_CefVersion_File TRUE) +endif() + +if(${Need_Config_CefVersion_File}) + message(STATUS "Need to configure CefVersion.h file") + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/src/CefVersion.h.in" + "${CMAKE_CURRENT_SOURCE_DIR}/include/CefVersion.h" + @ONLY + NEWLINE_STYLE UNIX + ) +else() + message(STATUS "No need to configure CefVersion.h file") +endif() diff --git a/include/CefVersion.h b/include/CefVersion.h new file mode 100644 index 0000000..da85c65 --- /dev/null +++ b/include/CefVersion.h @@ -0,0 +1,24 @@ +// +// CefVersion.h +// CefViewCore +// +// Created by Sheen Tian on 2025/1/19. +// This file was generated during CMake configuring. +// Do not edit this file directly by manual. +// Edit the CefVersion.h.in and then re-config project with CMake. +// + +#ifndef CefVersion_h +#define CefVersion_h +#pragma once + +// clang-format off +#define CEF_VERSION "127.3.5+g114ea2a+chromium-127.0.6533.120" +#define CEF_VERSION_MAJOR 127 +#define CEF_VERSION_MINOR 3 +#define CEF_VERSION_PATCH 5 +#define CEF_COMMIT_NUMBER 3037 +#define CEF_COMMIT_HASH "114ea2af1ba9da18c4ac5e599ccdbb17d01ba75a" +// clang-format on + +#endif // CefVersion diff --git a/include/CefViewBrowserClientDelegate.h b/include/CefViewBrowserClientDelegate.h index bf46171..37fa480 100644 --- a/include/CefViewBrowserClientDelegate.h +++ b/include/CefViewBrowserClientDelegate.h @@ -40,19 +40,19 @@ class CefViewBrowserClientDelegateInterface /// /// /// - /// + /// /// - virtual void processUrlRequest(CefRefPtr& browser, const CefFrameId& frameId, const CefString& url) = 0; + virtual void processUrlRequest(CefRefPtr& browser, CefRefPtr& frame, const CefString& url) = 0; /// /// /// /// - /// + /// /// /// virtual void processQueryRequest(CefRefPtr& browser, - const CefFrameId& frameId, + CefRefPtr& frame, const CefString& query, const int64_t query_id) = 0; @@ -60,21 +60,21 @@ class CefViewBrowserClientDelegateInterface /// /// /// - /// + /// /// virtual void focusedEditableNodeChanged(CefRefPtr& browser, - const CefFrameId& frameId, + CefRefPtr& frame, bool focusOnEditableNode) = 0; /// /// /// /// - /// + /// /// /// virtual void invokeMethodNotify(CefRefPtr& browser, - const CefFrameId& frameId, + CefRefPtr& frame, const CefString& method, const CefRefPtr& arguments) = 0; @@ -82,11 +82,11 @@ class CefViewBrowserClientDelegateInterface /// /// /// - /// + /// /// /// virtual void reportJSResult(CefRefPtr& browser, - const CefFrameId& frameId, + CefRefPtr& frame, const CefString& context, const CefRefPtr& result) = 0; @@ -127,7 +127,7 @@ class CefViewBrowserClientDelegateInterface // display handler #pragma region DisplayHandler - virtual void addressChanged(CefRefPtr& browser, const CefFrameId& frameId, const CefString& url) = 0; + virtual void addressChanged(CefRefPtr& browser, CefRefPtr& frame, const CefString& url) = 0; virtual void titleChanged(CefRefPtr& browser, const CefString& title) = 0; @@ -171,6 +171,7 @@ class CefViewBrowserClientDelegateInterface } virtual void draggableRegionChanged(CefRefPtr& browser, + CefRefPtr& frame, const std::vector& regions) = 0; #pragma endregion @@ -214,7 +215,7 @@ class CefViewBrowserClientDelegateInterface // life span handler #pragma region LifeSpanHandler virtual bool onBeforePopup(CefRefPtr& browser, - const CefFrameId& frameId, + CefRefPtr& frame, const CefString& targetUrl, const CefString& targetFrameName, CefLifeSpanHandler::WindowOpenDisposition targetDisposition, diff --git a/src/CefVersion.h.in b/src/CefVersion.h.in new file mode 100644 index 0000000..60f3514 --- /dev/null +++ b/src/CefVersion.h.in @@ -0,0 +1,24 @@ +// +// CefVersion.h +// CefViewCore +// +// Created by Sheen Tian on 2025/1/19. +// This file was generated during CMake configuring. +// Do not edit this file directly by manual. +// Edit the CefVersion.h.in and then re-config project with CMake. +// + +#ifndef CefVersion_h +#define CefVersion_h +#pragma once + +// clang-format off +#define CEF_VERSION "@CEF_VERSION@" +#define CEF_VERSION_MAJOR @CEF_VERSION_MAJOR@ +#define CEF_VERSION_MINOR @CEF_VERSION_MINOR@ +#define CEF_VERSION_PATCH @CEF_VERSION_PATCH@ +#define CEF_COMMIT_NUMBER @CEF_COMMIT_NUMBER@ +#define CEF_COMMIT_HASH "@CEF_COMMIT_HASH@" +// clang-format on + +#endif // CefVersion \ No newline at end of file diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp index 8244a4d..864748f 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp @@ -191,7 +191,7 @@ CefViewBrowserClient::OnRenderFocusedNodeChangedMessage(CefRefPtr br return false; bool focusOnEditableField = message->GetArgumentList()->GetBool(0); - delegate->focusedEditableNodeChanged(browser, frame->GetIdentifier(), focusOnEditableField); + delegate->focusedEditableNodeChanged(browser, frame, focusOnEditableField); return true; } @@ -223,7 +223,7 @@ CefViewBrowserClient::OnRenderInvokeMethodMessage(CefRefPtr browser, return false; arguments->Remove(0); - delegate->invokeMethodNotify(browser, frame->GetIdentifier(), method, arguments); + delegate->invokeMethodNotify(browser, frame, method, arguments); return true; } @@ -254,7 +254,7 @@ CefViewBrowserClient::OnRenderReportJSResultMessage(CefRefPtr browse // get script result auto result = arguments->GetValue(1); - delegate->reportJSResult(browser, frame->GetIdentifier(), context, result); + delegate->reportJSResult(browser, frame, context, result); return true; } diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient_DisplayHandler.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient_DisplayHandler.cpp index b4a7431..568a46b 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient_DisplayHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient_DisplayHandler.cpp @@ -21,7 +21,7 @@ CefViewBrowserClient::OnAddressChange(CefRefPtr browser, CefRefPtraddressChanged(browser, frame->GetIdentifier(), url); + delegate->addressChanged(browser, frame, url); } void diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient_DragHandler.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient_DragHandler.cpp index c663d29..2c0ed01 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient_DragHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient_DragHandler.cpp @@ -37,5 +37,5 @@ CefViewBrowserClient::OnDraggableRegionsChanged(CefRefPtr browser, auto delegate = client_delegate_.lock(); if (delegate) - delegate->draggableRegionChanged(browser, regions); + delegate->draggableRegionChanged(browser, frame, regions); } diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient_LifeSpanHandler.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient_LifeSpanHandler.cpp index 8045135..a9748b6 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient_LifeSpanHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient_LifeSpanHandler.cpp @@ -42,7 +42,7 @@ CefViewBrowserClient::OnBeforePopup(CefRefPtr browser, if (delegate) { bool disableJSAccess = no_javascript_access ? *no_javascript_access : false; result = delegate->onBeforePopup(browser, - frame->GetIdentifier(), + frame, target_url.ToString(), target_frame_name.ToString(), target_disposition, diff --git a/src/CefView/CefBrowserApp/CefViewQueryHandler/CefViewQueryHandler.cpp b/src/CefView/CefBrowserApp/CefViewQueryHandler/CefViewQueryHandler.cpp index 4bdc5a5..a75064b 100644 --- a/src/CefView/CefBrowserApp/CefViewQueryHandler/CefViewQueryHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewQueryHandler/CefViewQueryHandler.cpp @@ -44,7 +44,7 @@ CefViewQueryHandler::OnQuery(CefRefPtr browser, mapCallback_[query_id] = callback; mtxCallbackMap_.unlock(); - browserDelegate->processQueryRequest(browser, frame->GetIdentifier(), request.ToString(), query_id); + browserDelegate->processQueryRequest(browser, frame, request.ToString(), query_id); return true; } diff --git a/src/CefView/CefBrowserApp/CefViewSchemeHandler/CefViewSchemeHandler.cpp b/src/CefView/CefBrowserApp/CefViewSchemeHandler/CefViewSchemeHandler.cpp index 224e9fb..b9ea087 100644 --- a/src/CefView/CefBrowserApp/CefViewSchemeHandler/CefViewSchemeHandler.cpp +++ b/src/CefView/CefBrowserApp/CefViewSchemeHandler/CefViewSchemeHandler.cpp @@ -22,8 +22,7 @@ CefViewSchemeHandler::Open(CefRefPtr request, bool& handle_request, auto browserDelegate = handler_delegate_.lock(); if (browserDelegate) { CefString cefStrUrl = request->GetURL(); - CefFrameId frameId = frame_->GetIdentifier(); - browserDelegate->processUrlRequest(browser_, frameId, cefStrUrl.ToString()); + browserDelegate->processUrlRequest(browser_, frame_, cefStrUrl.ToString()); } data_ = "ok"; diff --git a/include/CefViewCoreProtocol.h.in b/src/CefViewCoreProtocol.h.in similarity index 100% rename from include/CefViewCoreProtocol.h.in rename to src/CefViewCoreProtocol.h.in