#include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h"
namespace {
int CEF_CALLBACK
scheme_registrar_add_custom_scheme(struct _cef_scheme_registrar_t* self,
const cef_string_t* scheme_name,
int options) {
DCHECK(self);
if (!self)
return 0;
DCHECK(scheme_name);
if (!scheme_name)
return 0;
bool _retval = CefSchemeRegistrarCppToC::Get(self)->AddCustomScheme(
CefString(scheme_name), options);
return _retval;
}
}
CefSchemeRegistrarCppToC::CefSchemeRegistrarCppToC() {
GetStruct()->add_custom_scheme = scheme_registrar_add_custom_scheme;
}
CefSchemeRegistrarCppToC::~CefSchemeRegistrarCppToC() {}
template <>
CefOwnPtr<CefSchemeRegistrar> CefCppToCScoped<
CefSchemeRegistrarCppToC,
CefSchemeRegistrar,
cef_scheme_registrar_t>::UnwrapDerivedOwn(CefWrapperType type,
cef_scheme_registrar_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return CefOwnPtr<CefSchemeRegistrar>();
}
template <>
CefRawPtr<CefSchemeRegistrar> CefCppToCScoped<
CefSchemeRegistrarCppToC,
CefSchemeRegistrar,
cef_scheme_registrar_t>::UnwrapDerivedRaw(CefWrapperType type,
cef_scheme_registrar_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType CefCppToCScoped<CefSchemeRegistrarCppToC,
CefSchemeRegistrar,
cef_scheme_registrar_t>::kWrapperType =
WT_SCHEME_REGISTRAR;