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=d334e579f498ad7727721dfe4e10ad810b81035a$
13 //
14
15 #include "libcef_dll/cpptoc/file_dialog_callback_cpptoc.h"
16 #include "libcef_dll/shutdown_checker.h"
17 #include "libcef_dll/transfer_util.h"
18
19 namespace {
20
21 // MEMBER FUNCTIONS - Body may be edited by hand.
22
23 void CEF_CALLBACK
file_dialog_callback_cont(struct _cef_file_dialog_callback_t * self,int selected_accept_filter,cef_string_list_t file_paths)24 file_dialog_callback_cont(struct _cef_file_dialog_callback_t* self,
25 int selected_accept_filter,
26 cef_string_list_t file_paths) {
27 shutdown_checker::AssertNotShutdown();
28
29 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
30
31 DCHECK(self);
32 if (!self)
33 return;
34 // Verify param: selected_accept_filter; type: simple_byval
35 DCHECK_GE(selected_accept_filter, 0);
36 if (selected_accept_filter < 0)
37 return;
38 // Unverified params: file_paths
39
40 // Translate param: file_paths; type: string_vec_byref_const
41 std::vector<CefString> file_pathsList;
42 transfer_string_list_contents(file_paths, file_pathsList);
43
44 // Execute
45 CefFileDialogCallbackCppToC::Get(self)->Continue(selected_accept_filter,
46 file_pathsList);
47 }
48
49 void CEF_CALLBACK
file_dialog_callback_cancel(struct _cef_file_dialog_callback_t * self)50 file_dialog_callback_cancel(struct _cef_file_dialog_callback_t* self) {
51 shutdown_checker::AssertNotShutdown();
52
53 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
54
55 DCHECK(self);
56 if (!self)
57 return;
58
59 // Execute
60 CefFileDialogCallbackCppToC::Get(self)->Cancel();
61 }
62
63 } // namespace
64
65 // CONSTRUCTOR - Do not edit by hand.
66
CefFileDialogCallbackCppToC()67 CefFileDialogCallbackCppToC::CefFileDialogCallbackCppToC() {
68 GetStruct()->cont = file_dialog_callback_cont;
69 GetStruct()->cancel = file_dialog_callback_cancel;
70 }
71
72 // DESTRUCTOR - Do not edit by hand.
73
~CefFileDialogCallbackCppToC()74 CefFileDialogCallbackCppToC::~CefFileDialogCallbackCppToC() {
75 shutdown_checker::AssertNotShutdown();
76 }
77
78 template <>
79 CefRefPtr<CefFileDialogCallback> CefCppToCRefCounted<
80 CefFileDialogCallbackCppToC,
81 CefFileDialogCallback,
UnwrapDerived(CefWrapperType type,cef_file_dialog_callback_t * s)82 cef_file_dialog_callback_t>::UnwrapDerived(CefWrapperType type,
83 cef_file_dialog_callback_t* s) {
84 NOTREACHED() << "Unexpected class type: " << type;
85 return nullptr;
86 }
87
88 template <>
89 CefWrapperType CefCppToCRefCounted<CefFileDialogCallbackCppToC,
90 CefFileDialogCallback,
91 cef_file_dialog_callback_t>::kWrapperType =
92 WT_FILE_DIALOG_CALLBACK;
93