2023-01-02 23:47:15 +01:00
|
|
|
// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
|
2017-08-04 00:55:19 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
2023-05-08 17:15:02 +02:00
|
|
|
// $hash=b1961c4ff6c203edef2f48bdbb5ac773815a15c7$
|
2017-08-04 00:55:19 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/extension_handler_ctocpp.h"
|
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/extension_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/get_extension_resource_callback_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/client_ctocpp.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-08-04 00:55:19 +02:00
|
|
|
void CefExtensionHandlerCToCpp::OnExtensionLoadFailed(cef_errorcode_t result) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_extension_load_failed)) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_extension_load_failed(_struct, result);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-08-04 00:55:19 +02:00
|
|
|
void CefExtensionHandlerCToCpp::OnExtensionLoaded(
|
|
|
|
CefRefPtr<CefExtension> extension) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_extension_loaded)) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_extension_loaded(_struct, CefExtensionCppToC::Wrap(extension));
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-08-04 00:55:19 +02:00
|
|
|
void CefExtensionHandlerCToCpp::OnExtensionUnloaded(
|
|
|
|
CefRefPtr<CefExtension> extension) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_extension_unloaded)) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_extension_unloaded(_struct, CefExtensionCppToC::Wrap(extension));
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-08-04 00:55:19 +02:00
|
|
|
bool CefExtensionHandlerCToCpp::OnBeforeBackgroundBrowser(
|
|
|
|
CefRefPtr<CefExtension> extension,
|
|
|
|
const CefString& url,
|
|
|
|
CefRefPtr<CefClient>& client,
|
|
|
|
CefBrowserSettings& settings) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_before_background_browser)) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(!url.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (url.empty()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Translate param: client; type: refptr_same_byref
|
|
|
|
cef_client_t* clientStruct = NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (client.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
clientStruct = CefClientCToCpp::Unwrap(client);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_client_t* clientOrig = clientStruct;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->on_before_background_browser(
|
|
|
|
_struct, CefExtensionCppToC::Wrap(extension), url.GetStruct(),
|
|
|
|
&clientStruct, &settings);
|
|
|
|
|
|
|
|
// Restore param:client; type: refptr_same_byref
|
|
|
|
if (clientStruct) {
|
|
|
|
if (clientStruct != clientOrig) {
|
|
|
|
client = CefClientCToCpp::Wrap(clientStruct);
|
2017-09-28 15:40:26 +02:00
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
client = nullptr;
|
2017-09-28 15:40:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-09-28 15:40:26 +02:00
|
|
|
bool CefExtensionHandlerCToCpp::OnBeforeBrowser(
|
|
|
|
CefRefPtr<CefExtension> extension,
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefBrowser> active_browser,
|
|
|
|
int index,
|
|
|
|
const CefString& url,
|
|
|
|
bool active,
|
|
|
|
CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient>& client,
|
|
|
|
CefBrowserSettings& settings) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-09-28 15:40:26 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_before_browser)) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension.get()) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: active_browser; type: refptr_diff
|
|
|
|
DCHECK(active_browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!active_browser.get()) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(!url.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (url.empty()) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
|
|
|
|
// Translate param: client; type: refptr_same_byref
|
|
|
|
cef_client_t* clientStruct = NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (client.get()) {
|
2017-09-28 15:40:26 +02:00
|
|
|
clientStruct = CefClientCToCpp::Unwrap(client);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
cef_client_t* clientOrig = clientStruct;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->on_before_browser(
|
|
|
|
_struct, CefExtensionCppToC::Wrap(extension),
|
|
|
|
CefBrowserCppToC::Wrap(browser), CefBrowserCppToC::Wrap(active_browser),
|
|
|
|
index, url.GetStruct(), active, &windowInfo, &clientStruct, &settings);
|
|
|
|
|
|
|
|
// Restore param:client; type: refptr_same_byref
|
|
|
|
if (clientStruct) {
|
|
|
|
if (clientStruct != clientOrig) {
|
|
|
|
client = CefClientCToCpp::Wrap(clientStruct);
|
2017-08-04 00:55:19 +02:00
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
client = nullptr;
|
2017-08-04 00:55:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-08-04 00:55:19 +02:00
|
|
|
CefRefPtr<CefBrowser> CefExtensionHandlerCToCpp::GetActiveBrowser(
|
|
|
|
CefRefPtr<CefExtension> extension,
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
bool include_incognito) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_active_browser)) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension.get()) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_browser_t* _retval = _struct->get_active_browser(
|
|
|
|
_struct, CefExtensionCppToC::Wrap(extension),
|
|
|
|
CefBrowserCppToC::Wrap(browser), include_incognito);
|
|
|
|
|
|
|
|
// Return type: refptr_diff
|
|
|
|
return CefBrowserCppToC::Unwrap(_retval);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-08-04 00:55:19 +02:00
|
|
|
bool CefExtensionHandlerCToCpp::CanAccessBrowser(
|
|
|
|
CefRefPtr<CefExtension> extension,
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
bool include_incognito,
|
|
|
|
CefRefPtr<CefBrowser> target_browser) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, can_access_browser)) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: target_browser; type: refptr_diff
|
|
|
|
DCHECK(target_browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!target_browser.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->can_access_browser(
|
|
|
|
_struct, CefExtensionCppToC::Wrap(extension),
|
|
|
|
CefBrowserCppToC::Wrap(browser), include_incognito,
|
|
|
|
CefBrowserCppToC::Wrap(target_browser));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-08-04 00:55:19 +02:00
|
|
|
bool CefExtensionHandlerCToCpp::GetExtensionResource(
|
|
|
|
CefRefPtr<CefExtension> extension,
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& file,
|
|
|
|
CefRefPtr<CefGetExtensionResourceCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_extension_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_extension_resource)) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: file; type: string_byref_const
|
|
|
|
DCHECK(!file.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (file.empty()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback.get()) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->get_extension_resource(
|
|
|
|
_struct, CefExtensionCppToC::Wrap(extension),
|
|
|
|
CefBrowserCppToC::Wrap(browser), file.GetStruct(),
|
|
|
|
CefGetExtensionResourceCallbackCppToC::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefExtensionHandlerCToCpp::CefExtensionHandlerCToCpp() {}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefExtensionHandlerCToCpp::~CefExtensionHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
template <>
|
|
|
|
cef_extension_handler_t* CefCToCppRefCounted<
|
|
|
|
CefExtensionHandlerCToCpp,
|
|
|
|
CefExtensionHandler,
|
|
|
|
cef_extension_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefExtensionHandler* c) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2017-08-04 00:55:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefExtensionHandlerCToCpp,
|
|
|
|
CefExtensionHandler,
|
|
|
|
cef_extension_handler_t>::kWrapperType =
|
|
|
|
WT_EXTENSION_HANDLER;
|