2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 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.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=8d8587b2574fa0274191b42dad62bb5bebe23f3e$
|
2017-08-04 00:55:19 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/extension_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/client_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/extension_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/get_extension_resource_callback_ctocpp.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2022-01-27 18:10:29 +01:00
|
|
|
#include "libcef_dll/template_util.h"
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
void CEF_CALLBACK extension_handler_on_extension_load_failed(
|
|
|
|
struct _cef_extension_handler_t* self,
|
|
|
|
cef_errorcode_t result) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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
|
|
|
|
CefExtensionHandlerCppToC::Get(self)->OnExtensionLoadFailed(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
extension_handler_on_extension_loaded(struct _cef_extension_handler_t* self,
|
|
|
|
cef_extension_t* extension) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension) {
|
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
|
|
|
|
CefExtensionHandlerCppToC::Get(self)->OnExtensionLoaded(
|
|
|
|
CefExtensionCToCpp::Wrap(extension));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK
|
|
|
|
extension_handler_on_extension_unloaded(struct _cef_extension_handler_t* self,
|
|
|
|
cef_extension_t* extension) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension) {
|
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
|
|
|
|
CefExtensionHandlerCppToC::Get(self)->OnExtensionUnloaded(
|
|
|
|
CefExtensionCToCpp::Wrap(extension));
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK extension_handler_on_before_background_browser(
|
|
|
|
struct _cef_extension_handler_t* self,
|
|
|
|
cef_extension_t* extension,
|
|
|
|
const cef_string_t* url,
|
|
|
|
cef_client_t** client,
|
|
|
|
struct _cef_browser_settings_t* settings) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!url) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: client; type: refptr_same_byref
|
|
|
|
DCHECK(client);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!client) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: settings; type: struct_byref
|
|
|
|
DCHECK(settings);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!settings) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-01-27 18:10:29 +01:00
|
|
|
if (!template_util::has_valid_size(settings)) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "invalid settings->[base.]size";
|
2022-01-27 18:10:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Translate param: client; type: refptr_same_byref
|
|
|
|
CefRefPtr<CefClient> clientPtr;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (client && *client) {
|
2017-08-04 00:55:19 +02:00
|
|
|
clientPtr = CefClientCppToC::Unwrap(*client);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
CefClient* clientOrig = clientPtr.get();
|
|
|
|
// Translate param: settings; type: struct_byref
|
|
|
|
CefBrowserSettings settingsObj;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (settings) {
|
2017-08-04 00:55:19 +02:00
|
|
|
settingsObj.AttachTo(*settings);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval =
|
|
|
|
CefExtensionHandlerCppToC::Get(self)->OnBeforeBackgroundBrowser(
|
|
|
|
CefExtensionCToCpp::Wrap(extension), CefString(url), clientPtr,
|
|
|
|
settingsObj);
|
|
|
|
|
|
|
|
// Restore param: client; type: refptr_same_byref
|
|
|
|
if (client) {
|
|
|
|
if (clientPtr.get()) {
|
|
|
|
if (clientPtr.get() != clientOrig) {
|
|
|
|
*client = CefClientCppToC::Wrap(clientPtr);
|
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
*client = nullptr;
|
2017-08-04 00:55:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Restore param: settings; type: struct_byref
|
2023-01-02 23:47:15 +01:00
|
|
|
if (settings) {
|
2017-08-04 00:55:19 +02:00
|
|
|
settingsObj.DetachTo(*settings);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-09-28 15:40:26 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
extension_handler_on_before_browser(struct _cef_extension_handler_t* self,
|
|
|
|
cef_extension_t* extension,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_browser_t* active_browser,
|
|
|
|
int index,
|
|
|
|
const cef_string_t* url,
|
|
|
|
int active,
|
|
|
|
cef_window_info_t* windowInfo,
|
|
|
|
cef_client_t** client,
|
|
|
|
struct _cef_browser_settings_t* settings) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-09-28 15:40:26 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!active_browser) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!url) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: windowInfo; type: struct_byref
|
|
|
|
DCHECK(windowInfo);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!windowInfo) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-01-27 18:10:29 +01:00
|
|
|
if (!template_util::has_valid_size(windowInfo)) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "invalid windowInfo->[base.]size";
|
2022-01-27 18:10:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: client; type: refptr_same_byref
|
|
|
|
DCHECK(client);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!client) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Verify param: settings; type: struct_byref
|
|
|
|
DCHECK(settings);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!settings) {
|
2017-09-28 15:40:26 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-01-27 18:10:29 +01:00
|
|
|
if (!template_util::has_valid_size(settings)) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "invalid settings->[base.]size";
|
2022-01-27 18:10:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
|
|
|
|
// Translate param: windowInfo; type: struct_byref
|
|
|
|
CefWindowInfo windowInfoObj;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (windowInfo) {
|
2017-09-28 15:40:26 +02:00
|
|
|
windowInfoObj.AttachTo(*windowInfo);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Translate param: client; type: refptr_same_byref
|
|
|
|
CefRefPtr<CefClient> clientPtr;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (client && *client) {
|
2017-09-28 15:40:26 +02:00
|
|
|
clientPtr = CefClientCppToC::Unwrap(*client);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
CefClient* clientOrig = clientPtr.get();
|
|
|
|
// Translate param: settings; type: struct_byref
|
|
|
|
CefBrowserSettings settingsObj;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (settings) {
|
2017-09-28 15:40:26 +02:00
|
|
|
settingsObj.AttachTo(*settings);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefExtensionHandlerCppToC::Get(self)->OnBeforeBrowser(
|
|
|
|
CefExtensionCToCpp::Wrap(extension), CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefBrowserCToCpp::Wrap(active_browser), index, CefString(url),
|
|
|
|
active ? true : false, windowInfoObj, clientPtr, settingsObj);
|
|
|
|
|
|
|
|
// Restore param: windowInfo; type: struct_byref
|
2023-01-02 23:47:15 +01:00
|
|
|
if (windowInfo) {
|
2017-09-28 15:40:26 +02:00
|
|
|
windowInfoObj.DetachTo(*windowInfo);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
// Restore param: client; type: refptr_same_byref
|
|
|
|
if (client) {
|
|
|
|
if (clientPtr.get()) {
|
|
|
|
if (clientPtr.get() != clientOrig) {
|
|
|
|
*client = CefClientCppToC::Wrap(clientPtr);
|
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
*client = nullptr;
|
2017-09-28 15:40:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Restore param: settings; type: struct_byref
|
2023-01-02 23:47:15 +01:00
|
|
|
if (settings) {
|
2017-09-28 15:40:26 +02:00
|
|
|
settingsObj.DetachTo(*settings);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-09-28 15:40:26 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
cef_browser_t* CEF_CALLBACK
|
|
|
|
extension_handler_get_active_browser(struct _cef_extension_handler_t* self,
|
|
|
|
cef_extension_t* extension,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
int include_incognito) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefBrowser> _retval =
|
|
|
|
CefExtensionHandlerCppToC::Get(self)->GetActiveBrowser(
|
|
|
|
CefExtensionCToCpp::Wrap(extension), CefBrowserCToCpp::Wrap(browser),
|
|
|
|
include_incognito ? true : false);
|
|
|
|
|
|
|
|
// Return type: refptr_diff
|
|
|
|
return CefBrowserCToCpp::Unwrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK
|
|
|
|
extension_handler_can_access_browser(struct _cef_extension_handler_t* self,
|
|
|
|
cef_extension_t* extension,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
int include_incognito,
|
|
|
|
cef_browser_t* target_browser) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!target_browser) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefExtensionHandlerCppToC::Get(self)->CanAccessBrowser(
|
|
|
|
CefExtensionCToCpp::Wrap(extension), CefBrowserCToCpp::Wrap(browser),
|
|
|
|
include_incognito ? true : false, CefBrowserCToCpp::Wrap(target_browser));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK extension_handler_get_extension_resource(
|
|
|
|
struct _cef_extension_handler_t* self,
|
|
|
|
cef_extension_t* extension,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
const cef_string_t* file,
|
|
|
|
cef_get_extension_resource_callback_t* callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: extension; type: refptr_diff
|
|
|
|
DCHECK(extension);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!extension) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!file) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback) {
|
2017-08-04 00:55:19 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-08-04 00:55:19 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefExtensionHandlerCppToC::Get(self)->GetExtensionResource(
|
|
|
|
CefExtensionCToCpp::Wrap(extension), CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefString(file), CefGetExtensionResourceCallbackCToCpp::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefExtensionHandlerCppToC::CefExtensionHandlerCppToC() {
|
|
|
|
GetStruct()->on_extension_load_failed =
|
|
|
|
extension_handler_on_extension_load_failed;
|
|
|
|
GetStruct()->on_extension_loaded = extension_handler_on_extension_loaded;
|
|
|
|
GetStruct()->on_extension_unloaded = extension_handler_on_extension_unloaded;
|
|
|
|
GetStruct()->on_before_background_browser =
|
|
|
|
extension_handler_on_before_background_browser;
|
2017-09-28 15:40:26 +02:00
|
|
|
GetStruct()->on_before_browser = extension_handler_on_before_browser;
|
2017-08-04 00:55:19 +02:00
|
|
|
GetStruct()->get_active_browser = extension_handler_get_active_browser;
|
|
|
|
GetStruct()->can_access_browser = extension_handler_can_access_browser;
|
|
|
|
GetStruct()->get_extension_resource =
|
|
|
|
extension_handler_get_extension_resource;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefExtensionHandlerCppToC::~CefExtensionHandlerCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefExtensionHandler> CefCppToCRefCounted<
|
|
|
|
CefExtensionHandlerCppToC,
|
|
|
|
CefExtensionHandler,
|
|
|
|
cef_extension_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_extension_handler_t* s) {
|
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 CefCppToCRefCounted<CefExtensionHandlerCppToC,
|
|
|
|
CefExtensionHandler,
|
|
|
|
cef_extension_handler_t>::kWrapperType =
|
|
|
|
WT_EXTENSION_HANDLER;
|