• 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=379974b466cf5b511906b6492c7fa594a26e4d33$
13 //
14 
15 #include "libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h"
16 #include "libcef_dll/cpptoc/browser_cpptoc.h"
17 #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h"
18 #include "libcef_dll/cpptoc/views/view_cpptoc.h"
19 #include "libcef_dll/ctocpp/client_ctocpp.h"
20 #include "libcef_dll/shutdown_checker.h"
21 
22 // VIRTUAL METHODS - Body may be edited by hand.
23 
24 NO_SANITIZE("cfi-icall")
OnBrowserCreated(CefRefPtr<CefBrowserView> browser_view,CefRefPtr<CefBrowser> browser)25 void CefBrowserViewDelegateCToCpp::OnBrowserCreated(
26     CefRefPtr<CefBrowserView> browser_view,
27     CefRefPtr<CefBrowser> browser) {
28   shutdown_checker::AssertNotShutdown();
29 
30   cef_browser_view_delegate_t* _struct = GetStruct();
31   if (CEF_MEMBER_MISSING(_struct, on_browser_created))
32     return;
33 
34   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
35 
36   // Verify param: browser_view; type: refptr_diff
37   DCHECK(browser_view.get());
38   if (!browser_view.get())
39     return;
40   // Verify param: browser; type: refptr_diff
41   DCHECK(browser.get());
42   if (!browser.get())
43     return;
44 
45   // Execute
46   _struct->on_browser_created(_struct, CefBrowserViewCppToC::Wrap(browser_view),
47                               CefBrowserCppToC::Wrap(browser));
48 }
49 
50 NO_SANITIZE("cfi-icall")
OnBrowserDestroyed(CefRefPtr<CefBrowserView> browser_view,CefRefPtr<CefBrowser> browser)51 void CefBrowserViewDelegateCToCpp::OnBrowserDestroyed(
52     CefRefPtr<CefBrowserView> browser_view,
53     CefRefPtr<CefBrowser> browser) {
54   shutdown_checker::AssertNotShutdown();
55 
56   cef_browser_view_delegate_t* _struct = GetStruct();
57   if (CEF_MEMBER_MISSING(_struct, on_browser_destroyed))
58     return;
59 
60   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
61 
62   // Verify param: browser_view; type: refptr_diff
63   DCHECK(browser_view.get());
64   if (!browser_view.get())
65     return;
66   // Verify param: browser; type: refptr_diff
67   DCHECK(browser.get());
68   if (!browser.get())
69     return;
70 
71   // Execute
72   _struct->on_browser_destroyed(_struct,
73                                 CefBrowserViewCppToC::Wrap(browser_view),
74                                 CefBrowserCppToC::Wrap(browser));
75 }
76 
77 NO_SANITIZE("cfi-icall")
78 CefRefPtr<CefBrowserViewDelegate>
GetDelegateForPopupBrowserView(CefRefPtr<CefBrowserView> browser_view,const CefBrowserSettings & settings,CefRefPtr<CefClient> client,bool is_devtools)79 CefBrowserViewDelegateCToCpp::GetDelegateForPopupBrowserView(
80     CefRefPtr<CefBrowserView> browser_view,
81     const CefBrowserSettings& settings,
82     CefRefPtr<CefClient> client,
83     bool is_devtools) {
84   shutdown_checker::AssertNotShutdown();
85 
86   cef_browser_view_delegate_t* _struct = GetStruct();
87   if (CEF_MEMBER_MISSING(_struct, get_delegate_for_popup_browser_view))
88     return nullptr;
89 
90   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
91 
92   // Verify param: browser_view; type: refptr_diff
93   DCHECK(browser_view.get());
94   if (!browser_view.get())
95     return nullptr;
96   // Verify param: client; type: refptr_same
97   DCHECK(client.get());
98   if (!client.get())
99     return nullptr;
100 
101   // Execute
102   cef_browser_view_delegate_t* _retval =
103       _struct->get_delegate_for_popup_browser_view(
104           _struct, CefBrowserViewCppToC::Wrap(browser_view), &settings,
105           CefClientCToCpp::Unwrap(client), is_devtools);
106 
107   // Return type: refptr_same
108   return CefBrowserViewDelegateCToCpp::Wrap(_retval);
109 }
110 
111 NO_SANITIZE("cfi-icall")
OnPopupBrowserViewCreated(CefRefPtr<CefBrowserView> browser_view,CefRefPtr<CefBrowserView> popup_browser_view,bool is_devtools)112 bool CefBrowserViewDelegateCToCpp::OnPopupBrowserViewCreated(
113     CefRefPtr<CefBrowserView> browser_view,
114     CefRefPtr<CefBrowserView> popup_browser_view,
115     bool is_devtools) {
116   shutdown_checker::AssertNotShutdown();
117 
118   cef_browser_view_delegate_t* _struct = GetStruct();
119   if (CEF_MEMBER_MISSING(_struct, on_popup_browser_view_created))
120     return false;
121 
122   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
123 
124   // Verify param: browser_view; type: refptr_diff
125   DCHECK(browser_view.get());
126   if (!browser_view.get())
127     return false;
128   // Verify param: popup_browser_view; type: refptr_diff
129   DCHECK(popup_browser_view.get());
130   if (!popup_browser_view.get())
131     return false;
132 
133   // Execute
134   int _retval = _struct->on_popup_browser_view_created(
135       _struct, CefBrowserViewCppToC::Wrap(browser_view),
136       CefBrowserViewCppToC::Wrap(popup_browser_view), is_devtools);
137 
138   // Return type: bool
139   return _retval ? true : false;
140 }
141 
142 NO_SANITIZE("cfi-icall")
143 CefBrowserViewDelegate::ChromeToolbarType
GetChromeToolbarType()144 CefBrowserViewDelegateCToCpp::GetChromeToolbarType() {
145   shutdown_checker::AssertNotShutdown();
146 
147   cef_browser_view_delegate_t* _struct = GetStruct();
148   if (CEF_MEMBER_MISSING(_struct, get_chrome_toolbar_type))
149     return CEF_CTT_NONE;
150 
151   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
152 
153   // Execute
154   cef_chrome_toolbar_type_t _retval = _struct->get_chrome_toolbar_type(_struct);
155 
156   // Return type: simple
157   return _retval;
158 }
159 
160 NO_SANITIZE("cfi-icall")
GetPreferredSize(CefRefPtr<CefView> view)161 CefSize CefBrowserViewDelegateCToCpp::GetPreferredSize(
162     CefRefPtr<CefView> view) {
163   shutdown_checker::AssertNotShutdown();
164 
165   cef_view_delegate_t* _struct =
166       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
167   if (CEF_MEMBER_MISSING(_struct, get_preferred_size))
168     return CefSize();
169 
170   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
171 
172   // Verify param: view; type: refptr_diff
173   DCHECK(view.get());
174   if (!view.get())
175     return CefSize();
176 
177   // Execute
178   cef_size_t _retval =
179       _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view));
180 
181   // Return type: simple
182   return _retval;
183 }
184 
185 NO_SANITIZE("cfi-icall")
GetMinimumSize(CefRefPtr<CefView> view)186 CefSize CefBrowserViewDelegateCToCpp::GetMinimumSize(CefRefPtr<CefView> view) {
187   shutdown_checker::AssertNotShutdown();
188 
189   cef_view_delegate_t* _struct =
190       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
191   if (CEF_MEMBER_MISSING(_struct, get_minimum_size))
192     return CefSize();
193 
194   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
195 
196   // Verify param: view; type: refptr_diff
197   DCHECK(view.get());
198   if (!view.get())
199     return CefSize();
200 
201   // Execute
202   cef_size_t _retval =
203       _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view));
204 
205   // Return type: simple
206   return _retval;
207 }
208 
209 NO_SANITIZE("cfi-icall")
GetMaximumSize(CefRefPtr<CefView> view)210 CefSize CefBrowserViewDelegateCToCpp::GetMaximumSize(CefRefPtr<CefView> view) {
211   shutdown_checker::AssertNotShutdown();
212 
213   cef_view_delegate_t* _struct =
214       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
215   if (CEF_MEMBER_MISSING(_struct, get_maximum_size))
216     return CefSize();
217 
218   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
219 
220   // Verify param: view; type: refptr_diff
221   DCHECK(view.get());
222   if (!view.get())
223     return CefSize();
224 
225   // Execute
226   cef_size_t _retval =
227       _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view));
228 
229   // Return type: simple
230   return _retval;
231 }
232 
233 NO_SANITIZE("cfi-icall")
GetHeightForWidth(CefRefPtr<CefView> view,int width)234 int CefBrowserViewDelegateCToCpp::GetHeightForWidth(CefRefPtr<CefView> view,
235                                                     int width) {
236   shutdown_checker::AssertNotShutdown();
237 
238   cef_view_delegate_t* _struct =
239       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
240   if (CEF_MEMBER_MISSING(_struct, get_height_for_width))
241     return 0;
242 
243   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
244 
245   // Verify param: view; type: refptr_diff
246   DCHECK(view.get());
247   if (!view.get())
248     return 0;
249 
250   // Execute
251   int _retval =
252       _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width);
253 
254   // Return type: simple
255   return _retval;
256 }
257 
258 NO_SANITIZE("cfi-icall")
OnParentViewChanged(CefRefPtr<CefView> view,bool added,CefRefPtr<CefView> parent)259 void CefBrowserViewDelegateCToCpp::OnParentViewChanged(
260     CefRefPtr<CefView> view,
261     bool added,
262     CefRefPtr<CefView> parent) {
263   shutdown_checker::AssertNotShutdown();
264 
265   cef_view_delegate_t* _struct =
266       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
267   if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed))
268     return;
269 
270   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
271 
272   // Verify param: view; type: refptr_diff
273   DCHECK(view.get());
274   if (!view.get())
275     return;
276   // Verify param: parent; type: refptr_diff
277   DCHECK(parent.get());
278   if (!parent.get())
279     return;
280 
281   // Execute
282   _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added,
283                                   CefViewCppToC::Wrap(parent));
284 }
285 
286 NO_SANITIZE("cfi-icall")
OnChildViewChanged(CefRefPtr<CefView> view,bool added,CefRefPtr<CefView> child)287 void CefBrowserViewDelegateCToCpp::OnChildViewChanged(
288     CefRefPtr<CefView> view,
289     bool added,
290     CefRefPtr<CefView> child) {
291   shutdown_checker::AssertNotShutdown();
292 
293   cef_view_delegate_t* _struct =
294       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
295   if (CEF_MEMBER_MISSING(_struct, on_child_view_changed))
296     return;
297 
298   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
299 
300   // Verify param: view; type: refptr_diff
301   DCHECK(view.get());
302   if (!view.get())
303     return;
304   // Verify param: child; type: refptr_diff
305   DCHECK(child.get());
306   if (!child.get())
307     return;
308 
309   // Execute
310   _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added,
311                                  CefViewCppToC::Wrap(child));
312 }
313 
314 NO_SANITIZE("cfi-icall")
OnWindowChanged(CefRefPtr<CefView> view,bool added)315 void CefBrowserViewDelegateCToCpp::OnWindowChanged(CefRefPtr<CefView> view,
316                                                    bool added) {
317   shutdown_checker::AssertNotShutdown();
318 
319   cef_view_delegate_t* _struct =
320       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
321   if (CEF_MEMBER_MISSING(_struct, on_window_changed))
322     return;
323 
324   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
325 
326   // Verify param: view; type: refptr_diff
327   DCHECK(view.get());
328   if (!view.get())
329     return;
330 
331   // Execute
332   _struct->on_window_changed(_struct, CefViewCppToC::Wrap(view), added);
333 }
334 
335 NO_SANITIZE("cfi-icall")
OnLayoutChanged(CefRefPtr<CefView> view,const CefRect & new_bounds)336 void CefBrowserViewDelegateCToCpp::OnLayoutChanged(CefRefPtr<CefView> view,
337                                                    const CefRect& new_bounds) {
338   shutdown_checker::AssertNotShutdown();
339 
340   cef_view_delegate_t* _struct =
341       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
342   if (CEF_MEMBER_MISSING(_struct, on_layout_changed))
343     return;
344 
345   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
346 
347   // Verify param: view; type: refptr_diff
348   DCHECK(view.get());
349   if (!view.get())
350     return;
351 
352   // Execute
353   _struct->on_layout_changed(_struct, CefViewCppToC::Wrap(view), &new_bounds);
354 }
355 
356 NO_SANITIZE("cfi-icall")
OnFocus(CefRefPtr<CefView> view)357 void CefBrowserViewDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
358   shutdown_checker::AssertNotShutdown();
359 
360   cef_view_delegate_t* _struct =
361       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
362   if (CEF_MEMBER_MISSING(_struct, on_focus))
363     return;
364 
365   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
366 
367   // Verify param: view; type: refptr_diff
368   DCHECK(view.get());
369   if (!view.get())
370     return;
371 
372   // Execute
373   _struct->on_focus(_struct, CefViewCppToC::Wrap(view));
374 }
375 
376 NO_SANITIZE("cfi-icall")
OnBlur(CefRefPtr<CefView> view)377 void CefBrowserViewDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
378   shutdown_checker::AssertNotShutdown();
379 
380   cef_view_delegate_t* _struct =
381       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
382   if (CEF_MEMBER_MISSING(_struct, on_blur))
383     return;
384 
385   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
386 
387   // Verify param: view; type: refptr_diff
388   DCHECK(view.get());
389   if (!view.get())
390     return;
391 
392   // Execute
393   _struct->on_blur(_struct, CefViewCppToC::Wrap(view));
394 }
395 
396 // CONSTRUCTOR - Do not edit by hand.
397 
CefBrowserViewDelegateCToCpp()398 CefBrowserViewDelegateCToCpp::CefBrowserViewDelegateCToCpp() {}
399 
400 // DESTRUCTOR - Do not edit by hand.
401 
~CefBrowserViewDelegateCToCpp()402 CefBrowserViewDelegateCToCpp::~CefBrowserViewDelegateCToCpp() {
403   shutdown_checker::AssertNotShutdown();
404 }
405 
406 template <>
407 cef_browser_view_delegate_t* CefCToCppRefCounted<
408     CefBrowserViewDelegateCToCpp,
409     CefBrowserViewDelegate,
UnwrapDerived(CefWrapperType type,CefBrowserViewDelegate * c)410     cef_browser_view_delegate_t>::UnwrapDerived(CefWrapperType type,
411                                                 CefBrowserViewDelegate* c) {
412   NOTREACHED() << "Unexpected class type: " << type;
413   return nullptr;
414 }
415 
416 template <>
417 CefWrapperType CefCToCppRefCounted<CefBrowserViewDelegateCToCpp,
418                                    CefBrowserViewDelegate,
419                                    cef_browser_view_delegate_t>::kWrapperType =
420     WT_BROWSER_VIEW_DELEGATE;
421