#include "libcef_dll/cpptoc/print_dialog_callback_cpptoc.h"
#include "libcef_dll/cpptoc/print_settings_cpptoc.h"
#include "libcef_dll/shutdown_checker.h"
namespace {
void CEF_CALLBACK
print_dialog_callback_cont(struct _cef_print_dialog_callback_t* self,
struct _cef_print_settings_t* settings) {
shutdown_checker::AssertNotShutdown();
DCHECK(self);
if (!self)
return;
DCHECK(settings);
if (!settings)
return;
CefPrintDialogCallbackCppToC::Get(self)->Continue(
CefPrintSettingsCppToC::Unwrap(settings));
}
void CEF_CALLBACK
print_dialog_callback_cancel(struct _cef_print_dialog_callback_t* self) {
shutdown_checker::AssertNotShutdown();
DCHECK(self);
if (!self)
return;
CefPrintDialogCallbackCppToC::Get(self)->Cancel();
}
}
CefPrintDialogCallbackCppToC::CefPrintDialogCallbackCppToC() {
GetStruct()->cont = print_dialog_callback_cont;
GetStruct()->cancel = print_dialog_callback_cancel;
}
CefPrintDialogCallbackCppToC::~CefPrintDialogCallbackCppToC() {
shutdown_checker::AssertNotShutdown();
}
template <>
CefRefPtr<CefPrintDialogCallback> CefCppToCRefCounted<
CefPrintDialogCallbackCppToC,
CefPrintDialogCallback,
cef_print_dialog_callback_t>::UnwrapDerived(CefWrapperType type,
cef_print_dialog_callback_t*
s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType CefCppToCRefCounted<CefPrintDialogCallbackCppToC,
CefPrintDialogCallback,
cef_print_dialog_callback_t>::kWrapperType =
WT_PRINT_DIALOG_CALLBACK;