#include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
#include "libcef_dll/transfer_util.h"
NO_SANITIZE("cfi-icall")
void CefFileDialogCallbackCToCpp::Continue(
int selected_accept_filter,
const std::vector<CefString>& file_paths) {
shutdown_checker::AssertNotShutdown();
cef_file_dialog_callback_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, cont))
return;
DCHECK_GE(selected_accept_filter, 0);
if (selected_accept_filter < 0)
return;
cef_string_list_t file_pathsList = cef_string_list_alloc();
DCHECK(file_pathsList);
if (file_pathsList)
transfer_string_list_contents(file_paths, file_pathsList);
_struct->cont(_struct, selected_accept_filter, file_pathsList);
if (file_pathsList)
cef_string_list_free(file_pathsList);
}
NO_SANITIZE("cfi-icall") void CefFileDialogCallbackCToCpp::Cancel() {
shutdown_checker::AssertNotShutdown();
cef_file_dialog_callback_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, cancel))
return;
_struct->cancel(_struct);
}
CefFileDialogCallbackCToCpp::CefFileDialogCallbackCToCpp() {}
CefFileDialogCallbackCToCpp::~CefFileDialogCallbackCToCpp() {
shutdown_checker::AssertNotShutdown();
}
template <>
cef_file_dialog_callback_t* CefCToCppRefCounted<
CefFileDialogCallbackCToCpp,
CefFileDialogCallback,
cef_file_dialog_callback_t>::UnwrapDerived(CefWrapperType type,
CefFileDialogCallback* c) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType CefCToCppRefCounted<CefFileDialogCallbackCToCpp,
CefFileDialogCallback,
cef_file_dialog_callback_t>::kWrapperType =
WT_FILE_DIALOG_CALLBACK;