2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
2012-10-16 21:28:07 +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-05-29 22:38:00 +02:00
|
|
|
// $hash=bd2c8c9be10525d69d072dacfb3cfd215486e077$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-10-16 21:28:07 +02:00
|
|
|
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/ctocpp/dialog_handler_ctocpp.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2012-10-16 21:28:07 +02:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2012-10-16 21:28:07 +02:00
|
|
|
#include "libcef_dll/transfer_util.h"
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-05-17 11:29:28 +02:00
|
|
|
bool CefDialogHandlerCToCpp::OnFileDialog(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
FileDialogMode mode,
|
|
|
|
const CefString& title,
|
2015-01-20 19:24:54 +01:00
|
|
|
const CefString& default_file_path,
|
2017-05-17 11:29:28 +02:00
|
|
|
const std::vector<CefString>& accept_filters,
|
2024-05-29 22:38:00 +02:00
|
|
|
const std::vector<CefString>& accept_extensions,
|
|
|
|
const std::vector<CefString>& accept_descriptions,
|
2012-10-16 21:28:07 +02:00
|
|
|
CefRefPtr<CefFileDialogCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_dialog_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_file_dialog)) {
|
2012-10-16 21:28:07 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-10-16 21:28:07 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser.get()) {
|
2012-10-16 21:28:07 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-10-16 21:28:07 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback.get()) {
|
2012-10-16 21:28:07 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2024-05-29 22:38:00 +02:00
|
|
|
// Unverified params: title, default_file_path, accept_filters,
|
|
|
|
// accept_extensions, accept_descriptions
|
2012-10-16 21:28:07 +02:00
|
|
|
|
2015-01-20 19:24:54 +01:00
|
|
|
// Translate param: accept_filters; type: string_vec_byref_const
|
|
|
|
cef_string_list_t accept_filtersList = cef_string_list_alloc();
|
|
|
|
DCHECK(accept_filtersList);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (accept_filtersList) {
|
2015-01-20 19:24:54 +01:00
|
|
|
transfer_string_list_contents(accept_filters, accept_filtersList);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2024-05-29 22:38:00 +02:00
|
|
|
// Translate param: accept_extensions; type: string_vec_byref_const
|
|
|
|
cef_string_list_t accept_extensionsList = cef_string_list_alloc();
|
|
|
|
DCHECK(accept_extensionsList);
|
|
|
|
if (accept_extensionsList) {
|
|
|
|
transfer_string_list_contents(accept_extensions, accept_extensionsList);
|
|
|
|
}
|
|
|
|
// Translate param: accept_descriptions; type: string_vec_byref_const
|
|
|
|
cef_string_list_t accept_descriptionsList = cef_string_list_alloc();
|
|
|
|
DCHECK(accept_descriptionsList);
|
|
|
|
if (accept_descriptionsList) {
|
|
|
|
transfer_string_list_contents(accept_descriptions, accept_descriptionsList);
|
|
|
|
}
|
2012-10-16 21:28:07 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
int _retval = _struct->on_file_dialog(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), mode, title.GetStruct(),
|
2024-05-29 22:38:00 +02:00
|
|
|
default_file_path.GetStruct(), accept_filtersList, accept_extensionsList,
|
|
|
|
accept_descriptionsList, CefFileDialogCallbackCppToC::Wrap(callback));
|
2012-10-16 21:28:07 +02:00
|
|
|
|
2015-01-20 19:24:54 +01:00
|
|
|
// Restore param:accept_filters; type: string_vec_byref_const
|
2023-01-02 23:47:15 +01:00
|
|
|
if (accept_filtersList) {
|
2015-01-20 19:24:54 +01:00
|
|
|
cef_string_list_free(accept_filtersList);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2024-05-29 22:38:00 +02:00
|
|
|
// Restore param:accept_extensions; type: string_vec_byref_const
|
|
|
|
if (accept_extensionsList) {
|
|
|
|
cef_string_list_free(accept_extensionsList);
|
|
|
|
}
|
|
|
|
// Restore param:accept_descriptions; type: string_vec_byref_const
|
|
|
|
if (accept_descriptionsList) {
|
|
|
|
cef_string_list_free(accept_descriptionsList);
|
|
|
|
}
|
2012-10-16 21:28:07 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-10-16 21:28:07 +02:00
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() {}
|
2015-04-26 20:40:01 +02:00
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefDialogHandlerCToCpp::~CefDialogHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
cef_dialog_handler_t*
|
|
|
|
CefCToCppRefCounted<CefDialogHandlerCToCpp,
|
|
|
|
CefDialogHandler,
|
|
|
|
cef_dialog_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefDialogHandler* c) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2015-04-26 20:40:01 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefDialogHandlerCToCpp,
|
|
|
|
CefDialogHandler,
|
|
|
|
cef_dialog_handler_t>::kWrapperType =
|
|
|
|
WT_DIALOG_HANDLER;
|