mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Support registration of custom preferences.
Custom global and request context preferences can now be registered via CefBrowserProcessHandler::OnRegisterCustomPreferences. CefRequestContext now extends CefPreferenceManager and global preferences can be accessed via CefPreferenceManager::GetGlobalPreferenceManager.
This commit is contained in:
@@ -9,15 +9,40 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=3302f28c60da03b9f5ba5fa110523b353765d1a3$
|
||||
// $hash=c6ad132e54265eb08e748bb22d2c90784ed098b0$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/command_line_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/preference_registrar_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/client_ctocpp.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefBrowserProcessHandlerCToCpp::OnRegisterCustomPreferences(
|
||||
cef_preferences_type_t type,
|
||||
CefRawPtr<CefPreferenceRegistrar> registrar) {
|
||||
cef_browser_process_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_register_custom_preferences))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: registrar; type: rawptr_diff
|
||||
DCHECK(registrar);
|
||||
if (!registrar)
|
||||
return;
|
||||
|
||||
// Translate param: registrar; type: rawptr_diff
|
||||
CefOwnPtr<CefPreferenceRegistrarCppToC> registrarPtr(
|
||||
CefPreferenceRegistrarCppToC::WrapRaw(registrar));
|
||||
|
||||
// Execute
|
||||
_struct->on_register_custom_preferences(_struct, type,
|
||||
registrarPtr->GetStruct());
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefBrowserProcessHandlerCToCpp::OnContextInitialized() {
|
||||
cef_browser_process_handler_t* _struct = GetStruct();
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=7a13d15a99d1c92a757b776bb00d932296012054$
|
||||
// $hash=dc8b4fabed723f33f4a5a7e668233a48913da2b4$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
|
||||
@@ -35,6 +35,9 @@ class CefBrowserProcessHandlerCToCpp
|
||||
virtual ~CefBrowserProcessHandlerCToCpp();
|
||||
|
||||
// CefBrowserProcessHandler methods.
|
||||
void OnRegisterCustomPreferences(
|
||||
cef_preferences_type_t type,
|
||||
CefRawPtr<CefPreferenceRegistrar> registrar) override;
|
||||
void OnContextInitialized() override;
|
||||
void OnBeforeChildProcessLaunch(
|
||||
CefRefPtr<CefCommandLine> command_line) override;
|
||||
|
166
libcef_dll/ctocpp/preference_manager_ctocpp.cc
Normal file
166
libcef_dll/ctocpp/preference_manager_ctocpp.cc
Normal file
@@ -0,0 +1,166 @@
|
||||
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=52f3ca6608adcc88d2fb8faf80f53255946880fc$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/preference_manager_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/request_context_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/value_ctocpp.h"
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefPreferenceManager>
|
||||
CefPreferenceManager::GetGlobalPreferenceManager() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_preference_manager_t* _retval = cef_preference_manager_get_global();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefPreferenceManagerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefPreferenceManagerCToCpp::HasPreference(const CefString& name) {
|
||||
cef_preference_manager_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, has_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->has_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefValue> CefPreferenceManagerCToCpp::GetPreference(
|
||||
const CefString& name) {
|
||||
cef_preference_manager_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_preference))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return nullptr;
|
||||
|
||||
// Execute
|
||||
cef_value_t* _retval = _struct->get_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefDictionaryValue> CefPreferenceManagerCToCpp::GetAllPreferences(
|
||||
bool include_defaults) {
|
||||
cef_preference_manager_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_all_preferences))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_dictionary_value_t* _retval =
|
||||
_struct->get_all_preferences(_struct, include_defaults);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefDictionaryValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefPreferenceManagerCToCpp::CanSetPreference(const CefString& name) {
|
||||
cef_preference_manager_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, can_set_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->can_set_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefPreferenceManagerCToCpp::SetPreference(const CefString& name,
|
||||
CefRefPtr<CefValue> value,
|
||||
CefString& error) {
|
||||
cef_preference_manager_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, set_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
// Unverified params: value
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->set_preference(_struct, name.GetStruct(),
|
||||
CefValueCToCpp::Unwrap(value),
|
||||
error.GetWritableStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPreferenceManagerCToCpp::CefPreferenceManagerCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPreferenceManagerCToCpp::~CefPreferenceManagerCToCpp() {}
|
||||
|
||||
template <>
|
||||
cef_preference_manager_t* CefCToCppRefCounted<
|
||||
CefPreferenceManagerCToCpp,
|
||||
CefPreferenceManager,
|
||||
cef_preference_manager_t>::UnwrapDerived(CefWrapperType type,
|
||||
CefPreferenceManager* c) {
|
||||
if (type == WT_REQUEST_CONTEXT) {
|
||||
return reinterpret_cast<cef_preference_manager_t*>(
|
||||
CefRequestContextCToCpp::Unwrap(
|
||||
reinterpret_cast<CefRequestContext*>(c)));
|
||||
}
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefPreferenceManagerCToCpp,
|
||||
CefPreferenceManager,
|
||||
cef_preference_manager_t>::kWrapperType =
|
||||
WT_PREFERENCE_MANAGER;
|
48
libcef_dll/ctocpp/preference_manager_ctocpp.h
Normal file
48
libcef_dll/ctocpp/preference_manager_ctocpp.h
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=ec2addea82a8ad9018bd3f8e8dee80c998c7229b$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_PREFERENCE_MANAGER_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_PREFERENCE_MANAGER_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_preference_capi.h"
|
||||
#include "include/cef_preference.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefPreferenceManagerCToCpp
|
||||
: public CefCToCppRefCounted<CefPreferenceManagerCToCpp,
|
||||
CefPreferenceManager,
|
||||
cef_preference_manager_t> {
|
||||
public:
|
||||
CefPreferenceManagerCToCpp();
|
||||
virtual ~CefPreferenceManagerCToCpp();
|
||||
|
||||
// CefPreferenceManager methods.
|
||||
bool HasPreference(const CefString& name) override;
|
||||
CefRefPtr<CefValue> GetPreference(const CefString& name) override;
|
||||
CefRefPtr<CefDictionaryValue> GetAllPreferences(
|
||||
bool include_defaults) override;
|
||||
bool CanSetPreference(const CefString& name) override;
|
||||
bool SetPreference(const CefString& name,
|
||||
CefRefPtr<CefValue> value,
|
||||
CefString& error) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_PREFERENCE_MANAGER_CTOCPP_H_
|
77
libcef_dll/ctocpp/preference_registrar_ctocpp.cc
Normal file
77
libcef_dll/ctocpp/preference_registrar_ctocpp.cc
Normal file
@@ -0,0 +1,77 @@
|
||||
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=c2a2edb07cc7aa06a63a71b626898213712a840a$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/preference_registrar_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/value_ctocpp.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefPreferenceRegistrarCToCpp::AddPreference(
|
||||
const CefString& name,
|
||||
CefRefPtr<CefValue> default_value) {
|
||||
cef_preference_registrar_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, add_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
// Verify param: default_value; type: refptr_same
|
||||
DCHECK(default_value.get());
|
||||
if (!default_value.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->add_preference(_struct, name.GetStruct(),
|
||||
CefValueCToCpp::Unwrap(default_value));
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPreferenceRegistrarCToCpp::CefPreferenceRegistrarCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPreferenceRegistrarCToCpp::~CefPreferenceRegistrarCToCpp() {}
|
||||
|
||||
template <>
|
||||
cef_preference_registrar_t* CefCToCppScoped<CefPreferenceRegistrarCToCpp,
|
||||
CefPreferenceRegistrar,
|
||||
cef_preference_registrar_t>::
|
||||
UnwrapDerivedOwn(CefWrapperType type, CefOwnPtr<CefPreferenceRegistrar> c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_preference_registrar_t* CefCToCppScoped<CefPreferenceRegistrarCToCpp,
|
||||
CefPreferenceRegistrar,
|
||||
cef_preference_registrar_t>::
|
||||
UnwrapDerivedRaw(CefWrapperType type, CefRawPtr<CefPreferenceRegistrar> c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppScoped<CefPreferenceRegistrarCToCpp,
|
||||
CefPreferenceRegistrar,
|
||||
cef_preference_registrar_t>::kWrapperType =
|
||||
WT_PREFERENCE_REGISTRAR;
|
42
libcef_dll/ctocpp/preference_registrar_ctocpp.h
Normal file
42
libcef_dll/ctocpp/preference_registrar_ctocpp.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
// $hash=ca84e9c8992668fc127f6aed0136687f0d5ce0a3$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_PREFERENCE_REGISTRAR_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_PREFERENCE_REGISTRAR_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_preference_capi.h"
|
||||
#include "include/cef_preference.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefPreferenceRegistrarCToCpp
|
||||
: public CefCToCppScoped<CefPreferenceRegistrarCToCpp,
|
||||
CefPreferenceRegistrar,
|
||||
cef_preference_registrar_t> {
|
||||
public:
|
||||
CefPreferenceRegistrarCToCpp();
|
||||
virtual ~CefPreferenceRegistrarCToCpp();
|
||||
|
||||
// CefPreferenceRegistrar methods.
|
||||
bool AddPreference(const CefString& name,
|
||||
CefRefPtr<CefValue> default_value) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_PREFERENCE_REGISTRAR_CTOCPP_H_
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=34a53ca8c93eb3dd0999d9e34d3f86307995e82d$
|
||||
// $hash=8abfb084742cdd3ed31754a33281f0eacfc5fceb$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/request_context_ctocpp.h"
|
||||
@@ -225,109 +225,6 @@ bool CefRequestContextCToCpp::ClearSchemeHandlerFactories() {
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefRequestContextCToCpp::HasPreference(const CefString& name) {
|
||||
cef_request_context_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, has_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->has_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefValue> CefRequestContextCToCpp::GetPreference(
|
||||
const CefString& name) {
|
||||
cef_request_context_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_preference))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return nullptr;
|
||||
|
||||
// Execute
|
||||
cef_value_t* _retval = _struct->get_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefDictionaryValue> CefRequestContextCToCpp::GetAllPreferences(
|
||||
bool include_defaults) {
|
||||
cef_request_context_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_all_preferences))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_dictionary_value_t* _retval =
|
||||
_struct->get_all_preferences(_struct, include_defaults);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefDictionaryValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefRequestContextCToCpp::CanSetPreference(const CefString& name) {
|
||||
cef_request_context_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, can_set_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->can_set_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefRequestContextCToCpp::SetPreference(const CefString& name,
|
||||
CefRefPtr<CefValue> value,
|
||||
CefString& error) {
|
||||
cef_request_context_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, set_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
// Unverified params: value
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->set_preference(_struct, name.GetStruct(),
|
||||
CefValueCToCpp::Unwrap(value),
|
||||
error.GetWritableStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefRequestContextCToCpp::ClearCertificateExceptions(
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
@@ -533,6 +430,114 @@ CefRefPtr<CefMediaRouter> CefRequestContextCToCpp::GetMediaRouter(
|
||||
return CefMediaRouterCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefRequestContextCToCpp::HasPreference(const CefString& name) {
|
||||
cef_preference_manager_t* _struct =
|
||||
reinterpret_cast<cef_preference_manager_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, has_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->has_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefValue> CefRequestContextCToCpp::GetPreference(
|
||||
const CefString& name) {
|
||||
cef_preference_manager_t* _struct =
|
||||
reinterpret_cast<cef_preference_manager_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, get_preference))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return nullptr;
|
||||
|
||||
// Execute
|
||||
cef_value_t* _retval = _struct->get_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefDictionaryValue> CefRequestContextCToCpp::GetAllPreferences(
|
||||
bool include_defaults) {
|
||||
cef_preference_manager_t* _struct =
|
||||
reinterpret_cast<cef_preference_manager_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, get_all_preferences))
|
||||
return nullptr;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_dictionary_value_t* _retval =
|
||||
_struct->get_all_preferences(_struct, include_defaults);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefDictionaryValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefRequestContextCToCpp::CanSetPreference(const CefString& name) {
|
||||
cef_preference_manager_t* _struct =
|
||||
reinterpret_cast<cef_preference_manager_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, can_set_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->can_set_preference(_struct, name.GetStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefRequestContextCToCpp::SetPreference(const CefString& name,
|
||||
CefRefPtr<CefValue> value,
|
||||
CefString& error) {
|
||||
cef_preference_manager_t* _struct =
|
||||
reinterpret_cast<cef_preference_manager_t*>(GetStruct());
|
||||
if (CEF_MEMBER_MISSING(_struct, set_preference))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: name; type: string_byref_const
|
||||
DCHECK(!name.empty());
|
||||
if (name.empty())
|
||||
return false;
|
||||
// Unverified params: value
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->set_preference(_struct, name.GetStruct(),
|
||||
CefValueCToCpp::Unwrap(value),
|
||||
error.GetWritableStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRequestContextCToCpp::CefRequestContextCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=693f5845874072abc324f643981531ed08d17b37$
|
||||
// $hash=92f03524a854cd701e24fadc9680585ef875a8c8$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_
|
||||
@@ -52,14 +52,6 @@ class CefRequestContextCToCpp
|
||||
const CefString& domain_name,
|
||||
CefRefPtr<CefSchemeHandlerFactory> factory) override;
|
||||
bool ClearSchemeHandlerFactories() override;
|
||||
bool HasPreference(const CefString& name) override;
|
||||
CefRefPtr<CefValue> GetPreference(const CefString& name) override;
|
||||
CefRefPtr<CefDictionaryValue> GetAllPreferences(
|
||||
bool include_defaults) override;
|
||||
bool CanSetPreference(const CefString& name) override;
|
||||
bool SetPreference(const CefString& name,
|
||||
CefRefPtr<CefValue> value,
|
||||
CefString& error) override;
|
||||
void ClearCertificateExceptions(
|
||||
CefRefPtr<CefCompletionCallback> callback) override;
|
||||
void ClearHttpAuthCredentials(
|
||||
@@ -76,6 +68,16 @@ class CefRequestContextCToCpp
|
||||
CefRefPtr<CefExtension> GetExtension(const CefString& extension_id) override;
|
||||
CefRefPtr<CefMediaRouter> GetMediaRouter(
|
||||
CefRefPtr<CefCompletionCallback> callback) override;
|
||||
|
||||
// CefPreferenceManager methods.
|
||||
bool HasPreference(const CefString& name) override;
|
||||
CefRefPtr<CefValue> GetPreference(const CefString& name) override;
|
||||
CefRefPtr<CefDictionaryValue> GetAllPreferences(
|
||||
bool include_defaults) override;
|
||||
bool CanSetPreference(const CefString& name) override;
|
||||
bool SetPreference(const CefString& name,
|
||||
CefRefPtr<CefValue> value,
|
||||
CefString& error) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_
|
||||
|
Reference in New Issue
Block a user