• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=2e6aa9015192a3704df073f7dad0c6fa3b05f76c$
13 //
14 
15 #include "libcef_dll/cpptoc/run_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 
run_file_dialog_callback_on_file_dialog_dismissed(struct _cef_run_file_dialog_callback_t * self,int selected_accept_filter,cef_string_list_t file_paths)23 void CEF_CALLBACK run_file_dialog_callback_on_file_dialog_dismissed(
24     struct _cef_run_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   CefRunFileDialogCallbackCppToC::Get(self)->OnFileDialogDismissed(
46       selected_accept_filter, file_pathsList);
47 }
48 
49 }  // namespace
50 
51 // CONSTRUCTOR - Do not edit by hand.
52 
CefRunFileDialogCallbackCppToC()53 CefRunFileDialogCallbackCppToC::CefRunFileDialogCallbackCppToC() {
54   GetStruct()->on_file_dialog_dismissed =
55       run_file_dialog_callback_on_file_dialog_dismissed;
56 }
57 
58 // DESTRUCTOR - Do not edit by hand.
59 
~CefRunFileDialogCallbackCppToC()60 CefRunFileDialogCallbackCppToC::~CefRunFileDialogCallbackCppToC() {
61   shutdown_checker::AssertNotShutdown();
62 }
63 
64 template <>
65 CefRefPtr<CefRunFileDialogCallback>
66 CefCppToCRefCounted<CefRunFileDialogCallbackCppToC,
67                     CefRunFileDialogCallback,
68                     cef_run_file_dialog_callback_t>::
UnwrapDerived(CefWrapperType type,cef_run_file_dialog_callback_t * s)69     UnwrapDerived(CefWrapperType type, cef_run_file_dialog_callback_t* s) {
70   NOTREACHED() << "Unexpected class type: " << type;
71   return nullptr;
72 }
73 
74 template <>
75 CefWrapperType
76     CefCppToCRefCounted<CefRunFileDialogCallbackCppToC,
77                         CefRunFileDialogCallback,
78                         cef_run_file_dialog_callback_t>::kWrapperType =
79         WT_RUN_FILE_DIALOG_CALLBACK;
80