• 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=f40564d59c337fede5e8c3121ed735166d5e05a3$
13 //
14 
15 #include "libcef_dll/ctocpp/display_handler_ctocpp.h"
16 #include "libcef_dll/cpptoc/browser_cpptoc.h"
17 #include "libcef_dll/cpptoc/frame_cpptoc.h"
18 #include "libcef_dll/shutdown_checker.h"
19 #include "libcef_dll/transfer_util.h"
20 
21 // VIRTUAL METHODS - Body may be edited by hand.
22 
23 NO_SANITIZE("cfi-icall")
OnAddressChange(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,const CefString & url)24 void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr<CefBrowser> browser,
25                                               CefRefPtr<CefFrame> frame,
26                                               const CefString& url) {
27   shutdown_checker::AssertNotShutdown();
28 
29   cef_display_handler_t* _struct = GetStruct();
30   if (CEF_MEMBER_MISSING(_struct, on_address_change))
31     return;
32 
33   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
34 
35   // Verify param: browser; type: refptr_diff
36   DCHECK(browser.get());
37   if (!browser.get())
38     return;
39   // Verify param: frame; type: refptr_diff
40   DCHECK(frame.get());
41   if (!frame.get())
42     return;
43   // Verify param: url; type: string_byref_const
44   DCHECK(!url.empty());
45   if (url.empty())
46     return;
47 
48   // Execute
49   _struct->on_address_change(_struct, CefBrowserCppToC::Wrap(browser),
50                              CefFrameCppToC::Wrap(frame), url.GetStruct());
51 }
52 
53 NO_SANITIZE("cfi-icall")
OnTitleChange(CefRefPtr<CefBrowser> browser,const CefString & title)54 void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr<CefBrowser> browser,
55                                             const CefString& title) {
56   shutdown_checker::AssertNotShutdown();
57 
58   cef_display_handler_t* _struct = GetStruct();
59   if (CEF_MEMBER_MISSING(_struct, on_title_change))
60     return;
61 
62   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
63 
64   // Verify param: browser; type: refptr_diff
65   DCHECK(browser.get());
66   if (!browser.get())
67     return;
68   // Unverified params: title
69 
70   // Execute
71   _struct->on_title_change(_struct, CefBrowserCppToC::Wrap(browser),
72                            title.GetStruct());
73 }
74 
75 NO_SANITIZE("cfi-icall")
OnFaviconURLChange(CefRefPtr<CefBrowser> browser,const std::vector<CefString> & icon_urls)76 void CefDisplayHandlerCToCpp::OnFaviconURLChange(
77     CefRefPtr<CefBrowser> browser,
78     const std::vector<CefString>& icon_urls) {
79   shutdown_checker::AssertNotShutdown();
80 
81   cef_display_handler_t* _struct = GetStruct();
82   if (CEF_MEMBER_MISSING(_struct, on_favicon_urlchange))
83     return;
84 
85   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
86 
87   // Verify param: browser; type: refptr_diff
88   DCHECK(browser.get());
89   if (!browser.get())
90     return;
91   // Unverified params: icon_urls
92 
93   // Translate param: icon_urls; type: string_vec_byref_const
94   cef_string_list_t icon_urlsList = cef_string_list_alloc();
95   DCHECK(icon_urlsList);
96   if (icon_urlsList)
97     transfer_string_list_contents(icon_urls, icon_urlsList);
98 
99   // Execute
100   _struct->on_favicon_urlchange(_struct, CefBrowserCppToC::Wrap(browser),
101                                 icon_urlsList);
102 
103   // Restore param:icon_urls; type: string_vec_byref_const
104   if (icon_urlsList)
105     cef_string_list_free(icon_urlsList);
106 }
107 
108 NO_SANITIZE("cfi-icall")
OnFullscreenModeChange(CefRefPtr<CefBrowser> browser,bool fullscreen)109 void CefDisplayHandlerCToCpp::OnFullscreenModeChange(
110     CefRefPtr<CefBrowser> browser,
111     bool fullscreen) {
112   shutdown_checker::AssertNotShutdown();
113 
114   cef_display_handler_t* _struct = GetStruct();
115   if (CEF_MEMBER_MISSING(_struct, on_fullscreen_mode_change))
116     return;
117 
118   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
119 
120   // Verify param: browser; type: refptr_diff
121   DCHECK(browser.get());
122   if (!browser.get())
123     return;
124 
125   // Execute
126   _struct->on_fullscreen_mode_change(_struct, CefBrowserCppToC::Wrap(browser),
127                                      fullscreen);
128 }
129 
130 NO_SANITIZE("cfi-icall")
OnTooltip(CefRefPtr<CefBrowser> browser,CefString & text)131 bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr<CefBrowser> browser,
132                                         CefString& text) {
133   shutdown_checker::AssertNotShutdown();
134 
135   cef_display_handler_t* _struct = GetStruct();
136   if (CEF_MEMBER_MISSING(_struct, on_tooltip))
137     return false;
138 
139   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
140 
141   // Verify param: browser; type: refptr_diff
142   DCHECK(browser.get());
143   if (!browser.get())
144     return false;
145   // Unverified params: text
146 
147   // Execute
148   int _retval = _struct->on_tooltip(_struct, CefBrowserCppToC::Wrap(browser),
149                                     text.GetWritableStruct());
150 
151   // Return type: bool
152   return _retval ? true : false;
153 }
154 
155 NO_SANITIZE("cfi-icall")
OnStatusMessage(CefRefPtr<CefBrowser> browser,const CefString & value)156 void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr<CefBrowser> browser,
157                                               const CefString& value) {
158   shutdown_checker::AssertNotShutdown();
159 
160   cef_display_handler_t* _struct = GetStruct();
161   if (CEF_MEMBER_MISSING(_struct, on_status_message))
162     return;
163 
164   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
165 
166   // Verify param: browser; type: refptr_diff
167   DCHECK(browser.get());
168   if (!browser.get())
169     return;
170   // Unverified params: value
171 
172   // Execute
173   _struct->on_status_message(_struct, CefBrowserCppToC::Wrap(browser),
174                              value.GetStruct());
175 }
176 
177 NO_SANITIZE("cfi-icall")
OnConsoleMessage(CefRefPtr<CefBrowser> browser,cef_log_severity_t level,const CefString & message,const CefString & source,int line)178 bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
179                                                cef_log_severity_t level,
180                                                const CefString& message,
181                                                const CefString& source,
182                                                int line) {
183   shutdown_checker::AssertNotShutdown();
184 
185   cef_display_handler_t* _struct = GetStruct();
186   if (CEF_MEMBER_MISSING(_struct, on_console_message))
187     return false;
188 
189   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
190 
191   // Verify param: browser; type: refptr_diff
192   DCHECK(browser.get());
193   if (!browser.get())
194     return false;
195   // Unverified params: message, source
196 
197   // Execute
198   int _retval = _struct->on_console_message(
199       _struct, CefBrowserCppToC::Wrap(browser), level, message.GetStruct(),
200       source.GetStruct(), line);
201 
202   // Return type: bool
203   return _retval ? true : false;
204 }
205 
206 NO_SANITIZE("cfi-icall")
OnAutoResize(CefRefPtr<CefBrowser> browser,const CefSize & new_size)207 bool CefDisplayHandlerCToCpp::OnAutoResize(CefRefPtr<CefBrowser> browser,
208                                            const CefSize& new_size) {
209   shutdown_checker::AssertNotShutdown();
210 
211   cef_display_handler_t* _struct = GetStruct();
212   if (CEF_MEMBER_MISSING(_struct, on_auto_resize))
213     return false;
214 
215   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
216 
217   // Verify param: browser; type: refptr_diff
218   DCHECK(browser.get());
219   if (!browser.get())
220     return false;
221 
222   // Execute
223   int _retval = _struct->on_auto_resize(
224       _struct, CefBrowserCppToC::Wrap(browser), &new_size);
225 
226   // Return type: bool
227   return _retval ? true : false;
228 }
229 
230 NO_SANITIZE("cfi-icall")
OnLoadingProgressChange(CefRefPtr<CefBrowser> browser,double progress)231 void CefDisplayHandlerCToCpp::OnLoadingProgressChange(
232     CefRefPtr<CefBrowser> browser,
233     double progress) {
234   shutdown_checker::AssertNotShutdown();
235 
236   cef_display_handler_t* _struct = GetStruct();
237   if (CEF_MEMBER_MISSING(_struct, on_loading_progress_change))
238     return;
239 
240   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
241 
242   // Verify param: browser; type: refptr_diff
243   DCHECK(browser.get());
244   if (!browser.get())
245     return;
246 
247   // Execute
248   _struct->on_loading_progress_change(_struct, CefBrowserCppToC::Wrap(browser),
249                                       progress);
250 }
251 
252 NO_SANITIZE("cfi-icall")
OnCursorChange(CefRefPtr<CefBrowser> browser,CefCursorHandle cursor,cef_cursor_type_t type,const CefCursorInfo & custom_cursor_info)253 bool CefDisplayHandlerCToCpp::OnCursorChange(
254     CefRefPtr<CefBrowser> browser,
255     CefCursorHandle cursor,
256     cef_cursor_type_t type,
257     const CefCursorInfo& custom_cursor_info) {
258   shutdown_checker::AssertNotShutdown();
259 
260   cef_display_handler_t* _struct = GetStruct();
261   if (CEF_MEMBER_MISSING(_struct, on_cursor_change))
262     return false;
263 
264   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
265 
266   // Verify param: browser; type: refptr_diff
267   DCHECK(browser.get());
268   if (!browser.get())
269     return false;
270 
271   // Execute
272   int _retval =
273       _struct->on_cursor_change(_struct, CefBrowserCppToC::Wrap(browser),
274                                 cursor, type, &custom_cursor_info);
275 
276   // Return type: bool
277   return _retval ? true : false;
278 }
279 
280 // CONSTRUCTOR - Do not edit by hand.
281 
CefDisplayHandlerCToCpp()282 CefDisplayHandlerCToCpp::CefDisplayHandlerCToCpp() {}
283 
284 // DESTRUCTOR - Do not edit by hand.
285 
~CefDisplayHandlerCToCpp()286 CefDisplayHandlerCToCpp::~CefDisplayHandlerCToCpp() {
287   shutdown_checker::AssertNotShutdown();
288 }
289 
290 template <>
291 cef_display_handler_t* CefCToCppRefCounted<
292     CefDisplayHandlerCToCpp,
293     CefDisplayHandler,
UnwrapDerived(CefWrapperType type,CefDisplayHandler * c)294     cef_display_handler_t>::UnwrapDerived(CefWrapperType type,
295                                           CefDisplayHandler* c) {
296   NOTREACHED() << "Unexpected class type: " << type;
297   return nullptr;
298 }
299 
300 template <>
301 CefWrapperType CefCToCppRefCounted<CefDisplayHandlerCToCpp,
302                                    CefDisplayHandler,
303                                    cef_display_handler_t>::kWrapperType =
304     WT_DISPLAY_HANDLER;
305