• 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=5c9e95dca457958e3b49c85b9fd39b36bf555d4e$
13 //
14 
15 #include "libcef_dll/cpptoc/client_cpptoc.h"
16 #include "libcef_dll/cpptoc/audio_handler_cpptoc.h"
17 #include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h"
18 #include "libcef_dll/cpptoc/dialog_handler_cpptoc.h"
19 #include "libcef_dll/cpptoc/display_handler_cpptoc.h"
20 #include "libcef_dll/cpptoc/download_handler_cpptoc.h"
21 #include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
22 #include "libcef_dll/cpptoc/find_handler_cpptoc.h"
23 #include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
24 #include "libcef_dll/cpptoc/frame_handler_cpptoc.h"
25 #include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
26 #include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h"
27 #include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
28 #include "libcef_dll/cpptoc/load_handler_cpptoc.h"
29 #include "libcef_dll/cpptoc/print_handler_cpptoc.h"
30 #include "libcef_dll/cpptoc/render_handler_cpptoc.h"
31 #include "libcef_dll/cpptoc/request_handler_cpptoc.h"
32 #include "libcef_dll/ctocpp/browser_ctocpp.h"
33 #include "libcef_dll/ctocpp/frame_ctocpp.h"
34 #include "libcef_dll/ctocpp/process_message_ctocpp.h"
35 
36 namespace {
37 
38 // MEMBER FUNCTIONS - Body may be edited by hand.
39 
40 cef_audio_handler_t* CEF_CALLBACK
client_get_audio_handler(struct _cef_client_t * self)41 client_get_audio_handler(struct _cef_client_t* self) {
42   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
43 
44   DCHECK(self);
45   if (!self)
46     return NULL;
47 
48   // Execute
49   CefRefPtr<CefAudioHandler> _retval =
50       CefClientCppToC::Get(self)->GetAudioHandler();
51 
52   // Return type: refptr_same
53   return CefAudioHandlerCppToC::Wrap(_retval);
54 }
55 
56 struct _cef_context_menu_handler_t* CEF_CALLBACK
client_get_context_menu_handler(struct _cef_client_t * self)57 client_get_context_menu_handler(struct _cef_client_t* self) {
58   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
59 
60   DCHECK(self);
61   if (!self)
62     return NULL;
63 
64   // Execute
65   CefRefPtr<CefContextMenuHandler> _retval =
66       CefClientCppToC::Get(self)->GetContextMenuHandler();
67 
68   // Return type: refptr_same
69   return CefContextMenuHandlerCppToC::Wrap(_retval);
70 }
71 
72 struct _cef_dialog_handler_t* CEF_CALLBACK
client_get_dialog_handler(struct _cef_client_t * self)73 client_get_dialog_handler(struct _cef_client_t* self) {
74   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
75 
76   DCHECK(self);
77   if (!self)
78     return NULL;
79 
80   // Execute
81   CefRefPtr<CefDialogHandler> _retval =
82       CefClientCppToC::Get(self)->GetDialogHandler();
83 
84   // Return type: refptr_same
85   return CefDialogHandlerCppToC::Wrap(_retval);
86 }
87 
88 struct _cef_display_handler_t* CEF_CALLBACK
client_get_display_handler(struct _cef_client_t * self)89 client_get_display_handler(struct _cef_client_t* self) {
90   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
91 
92   DCHECK(self);
93   if (!self)
94     return NULL;
95 
96   // Execute
97   CefRefPtr<CefDisplayHandler> _retval =
98       CefClientCppToC::Get(self)->GetDisplayHandler();
99 
100   // Return type: refptr_same
101   return CefDisplayHandlerCppToC::Wrap(_retval);
102 }
103 
104 struct _cef_download_handler_t* CEF_CALLBACK
client_get_download_handler(struct _cef_client_t * self)105 client_get_download_handler(struct _cef_client_t* self) {
106   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
107 
108   DCHECK(self);
109   if (!self)
110     return NULL;
111 
112   // Execute
113   CefRefPtr<CefDownloadHandler> _retval =
114       CefClientCppToC::Get(self)->GetDownloadHandler();
115 
116   // Return type: refptr_same
117   return CefDownloadHandlerCppToC::Wrap(_retval);
118 }
119 
120 struct _cef_drag_handler_t* CEF_CALLBACK
client_get_drag_handler(struct _cef_client_t * self)121 client_get_drag_handler(struct _cef_client_t* self) {
122   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
123 
124   DCHECK(self);
125   if (!self)
126     return NULL;
127 
128   // Execute
129   CefRefPtr<CefDragHandler> _retval =
130       CefClientCppToC::Get(self)->GetDragHandler();
131 
132   // Return type: refptr_same
133   return CefDragHandlerCppToC::Wrap(_retval);
134 }
135 
136 struct _cef_find_handler_t* CEF_CALLBACK
client_get_find_handler(struct _cef_client_t * self)137 client_get_find_handler(struct _cef_client_t* self) {
138   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
139 
140   DCHECK(self);
141   if (!self)
142     return NULL;
143 
144   // Execute
145   CefRefPtr<CefFindHandler> _retval =
146       CefClientCppToC::Get(self)->GetFindHandler();
147 
148   // Return type: refptr_same
149   return CefFindHandlerCppToC::Wrap(_retval);
150 }
151 
152 struct _cef_focus_handler_t* CEF_CALLBACK
client_get_focus_handler(struct _cef_client_t * self)153 client_get_focus_handler(struct _cef_client_t* self) {
154   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
155 
156   DCHECK(self);
157   if (!self)
158     return NULL;
159 
160   // Execute
161   CefRefPtr<CefFocusHandler> _retval =
162       CefClientCppToC::Get(self)->GetFocusHandler();
163 
164   // Return type: refptr_same
165   return CefFocusHandlerCppToC::Wrap(_retval);
166 }
167 
168 struct _cef_frame_handler_t* CEF_CALLBACK
client_get_frame_handler(struct _cef_client_t * self)169 client_get_frame_handler(struct _cef_client_t* self) {
170   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
171 
172   DCHECK(self);
173   if (!self)
174     return NULL;
175 
176   // Execute
177   CefRefPtr<CefFrameHandler> _retval =
178       CefClientCppToC::Get(self)->GetFrameHandler();
179 
180   // Return type: refptr_same
181   return CefFrameHandlerCppToC::Wrap(_retval);
182 }
183 
184 struct _cef_jsdialog_handler_t* CEF_CALLBACK
client_get_jsdialog_handler(struct _cef_client_t * self)185 client_get_jsdialog_handler(struct _cef_client_t* self) {
186   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
187 
188   DCHECK(self);
189   if (!self)
190     return NULL;
191 
192   // Execute
193   CefRefPtr<CefJSDialogHandler> _retval =
194       CefClientCppToC::Get(self)->GetJSDialogHandler();
195 
196   // Return type: refptr_same
197   return CefJSDialogHandlerCppToC::Wrap(_retval);
198 }
199 
200 struct _cef_keyboard_handler_t* CEF_CALLBACK
client_get_keyboard_handler(struct _cef_client_t * self)201 client_get_keyboard_handler(struct _cef_client_t* self) {
202   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
203 
204   DCHECK(self);
205   if (!self)
206     return NULL;
207 
208   // Execute
209   CefRefPtr<CefKeyboardHandler> _retval =
210       CefClientCppToC::Get(self)->GetKeyboardHandler();
211 
212   // Return type: refptr_same
213   return CefKeyboardHandlerCppToC::Wrap(_retval);
214 }
215 
216 struct _cef_life_span_handler_t* CEF_CALLBACK
client_get_life_span_handler(struct _cef_client_t * self)217 client_get_life_span_handler(struct _cef_client_t* self) {
218   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
219 
220   DCHECK(self);
221   if (!self)
222     return NULL;
223 
224   // Execute
225   CefRefPtr<CefLifeSpanHandler> _retval =
226       CefClientCppToC::Get(self)->GetLifeSpanHandler();
227 
228   // Return type: refptr_same
229   return CefLifeSpanHandlerCppToC::Wrap(_retval);
230 }
231 
232 struct _cef_load_handler_t* CEF_CALLBACK
client_get_load_handler(struct _cef_client_t * self)233 client_get_load_handler(struct _cef_client_t* self) {
234   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
235 
236   DCHECK(self);
237   if (!self)
238     return NULL;
239 
240   // Execute
241   CefRefPtr<CefLoadHandler> _retval =
242       CefClientCppToC::Get(self)->GetLoadHandler();
243 
244   // Return type: refptr_same
245   return CefLoadHandlerCppToC::Wrap(_retval);
246 }
247 
248 struct _cef_print_handler_t* CEF_CALLBACK
client_get_print_handler(struct _cef_client_t * self)249 client_get_print_handler(struct _cef_client_t* self) {
250   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
251 
252   DCHECK(self);
253   if (!self)
254     return NULL;
255 
256   // Execute
257   CefRefPtr<CefPrintHandler> _retval =
258       CefClientCppToC::Get(self)->GetPrintHandler();
259 
260   // Return type: refptr_same
261   return CefPrintHandlerCppToC::Wrap(_retval);
262 }
263 
264 struct _cef_render_handler_t* CEF_CALLBACK
client_get_render_handler(struct _cef_client_t * self)265 client_get_render_handler(struct _cef_client_t* self) {
266   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
267 
268   DCHECK(self);
269   if (!self)
270     return NULL;
271 
272   // Execute
273   CefRefPtr<CefRenderHandler> _retval =
274       CefClientCppToC::Get(self)->GetRenderHandler();
275 
276   // Return type: refptr_same
277   return CefRenderHandlerCppToC::Wrap(_retval);
278 }
279 
280 struct _cef_request_handler_t* CEF_CALLBACK
client_get_request_handler(struct _cef_client_t * self)281 client_get_request_handler(struct _cef_client_t* self) {
282   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
283 
284   DCHECK(self);
285   if (!self)
286     return NULL;
287 
288   // Execute
289   CefRefPtr<CefRequestHandler> _retval =
290       CefClientCppToC::Get(self)->GetRequestHandler();
291 
292   // Return type: refptr_same
293   return CefRequestHandlerCppToC::Wrap(_retval);
294 }
295 
296 int CEF_CALLBACK
client_on_process_message_received(struct _cef_client_t * self,cef_browser_t * browser,struct _cef_frame_t * frame,cef_process_id_t source_process,struct _cef_process_message_t * message)297 client_on_process_message_received(struct _cef_client_t* self,
298                                    cef_browser_t* browser,
299                                    struct _cef_frame_t* frame,
300                                    cef_process_id_t source_process,
301                                    struct _cef_process_message_t* message) {
302   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
303 
304   DCHECK(self);
305   if (!self)
306     return 0;
307   // Verify param: browser; type: refptr_diff
308   DCHECK(browser);
309   if (!browser)
310     return 0;
311   // Verify param: frame; type: refptr_diff
312   DCHECK(frame);
313   if (!frame)
314     return 0;
315   // Verify param: message; type: refptr_diff
316   DCHECK(message);
317   if (!message)
318     return 0;
319 
320   // Execute
321   bool _retval = CefClientCppToC::Get(self)->OnProcessMessageReceived(
322       CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
323       source_process, CefProcessMessageCToCpp::Wrap(message));
324 
325   // Return type: bool
326   return _retval;
327 }
328 
329 }  // namespace
330 
331 // CONSTRUCTOR - Do not edit by hand.
332 
CefClientCppToC()333 CefClientCppToC::CefClientCppToC() {
334   GetStruct()->get_audio_handler = client_get_audio_handler;
335   GetStruct()->get_context_menu_handler = client_get_context_menu_handler;
336   GetStruct()->get_dialog_handler = client_get_dialog_handler;
337   GetStruct()->get_display_handler = client_get_display_handler;
338   GetStruct()->get_download_handler = client_get_download_handler;
339   GetStruct()->get_drag_handler = client_get_drag_handler;
340   GetStruct()->get_find_handler = client_get_find_handler;
341   GetStruct()->get_focus_handler = client_get_focus_handler;
342   GetStruct()->get_frame_handler = client_get_frame_handler;
343   GetStruct()->get_jsdialog_handler = client_get_jsdialog_handler;
344   GetStruct()->get_keyboard_handler = client_get_keyboard_handler;
345   GetStruct()->get_life_span_handler = client_get_life_span_handler;
346   GetStruct()->get_load_handler = client_get_load_handler;
347   GetStruct()->get_print_handler = client_get_print_handler;
348   GetStruct()->get_render_handler = client_get_render_handler;
349   GetStruct()->get_request_handler = client_get_request_handler;
350   GetStruct()->on_process_message_received = client_on_process_message_received;
351 }
352 
353 // DESTRUCTOR - Do not edit by hand.
354 
~CefClientCppToC()355 CefClientCppToC::~CefClientCppToC() {}
356 
357 template <>
358 CefRefPtr<CefClient>
UnwrapDerived(CefWrapperType type,cef_client_t * s)359 CefCppToCRefCounted<CefClientCppToC, CefClient, cef_client_t>::UnwrapDerived(
360     CefWrapperType type,
361     cef_client_t* s) {
362   NOTREACHED() << "Unexpected class type: " << type;
363   return nullptr;
364 }
365 
366 template <>
367 CefWrapperType CefCppToCRefCounted<CefClientCppToC, CefClient, cef_client_t>::
368     kWrapperType = WT_CLIENT;
369