1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=cb29585261ed25ddd2ee1b4b5c890565e72e5d22$
13 //
14
15 #include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h"
16 #include "libcef_dll/shutdown_checker.h"
17 #include "libcef_dll/transfer_util.h"
18
19 // VIRTUAL METHODS - Body may be edited by hand.
20
21 NO_SANITIZE("cfi-icall")
OnFileDialogDismissed(int selected_accept_filter,const std::vector<CefString> & file_paths)22 void CefRunFileDialogCallbackCToCpp::OnFileDialogDismissed(
23 int selected_accept_filter,
24 const std::vector<CefString>& file_paths) {
25 shutdown_checker::AssertNotShutdown();
26
27 cef_run_file_dialog_callback_t* _struct = GetStruct();
28 if (CEF_MEMBER_MISSING(_struct, on_file_dialog_dismissed))
29 return;
30
31 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
32
33 // Verify param: selected_accept_filter; type: simple_byval
34 DCHECK_GE(selected_accept_filter, 0);
35 if (selected_accept_filter < 0)
36 return;
37 // Unverified params: file_paths
38
39 // Translate param: file_paths; type: string_vec_byref_const
40 cef_string_list_t file_pathsList = cef_string_list_alloc();
41 DCHECK(file_pathsList);
42 if (file_pathsList)
43 transfer_string_list_contents(file_paths, file_pathsList);
44
45 // Execute
46 _struct->on_file_dialog_dismissed(_struct, selected_accept_filter,
47 file_pathsList);
48
49 // Restore param:file_paths; type: string_vec_byref_const
50 if (file_pathsList)
51 cef_string_list_free(file_pathsList);
52 }
53
54 // CONSTRUCTOR - Do not edit by hand.
55
CefRunFileDialogCallbackCToCpp()56 CefRunFileDialogCallbackCToCpp::CefRunFileDialogCallbackCToCpp() {}
57
58 // DESTRUCTOR - Do not edit by hand.
59
~CefRunFileDialogCallbackCToCpp()60 CefRunFileDialogCallbackCToCpp::~CefRunFileDialogCallbackCToCpp() {
61 shutdown_checker::AssertNotShutdown();
62 }
63
64 template <>
65 cef_run_file_dialog_callback_t* CefCToCppRefCounted<
66 CefRunFileDialogCallbackCToCpp,
67 CefRunFileDialogCallback,
UnwrapDerived(CefWrapperType type,CefRunFileDialogCallback * c)68 cef_run_file_dialog_callback_t>::UnwrapDerived(CefWrapperType type,
69 CefRunFileDialogCallback*
70 c) {
71 NOTREACHED() << "Unexpected class type: " << type;
72 return nullptr;
73 }
74
75 template <>
76 CefWrapperType
77 CefCToCppRefCounted<CefRunFileDialogCallbackCToCpp,
78 CefRunFileDialogCallback,
79 cef_run_file_dialog_callback_t>::kWrapperType =
80 WT_RUN_FILE_DIALOG_CALLBACK;
81