• 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=09421982fe76735de86b67b1f7d8828a1cc36f6e$
13 //
14 
15 #include "libcef_dll/ctocpp/menu_model_delegate_ctocpp.h"
16 #include "libcef_dll/cpptoc/menu_model_cpptoc.h"
17 #include "libcef_dll/shutdown_checker.h"
18 
19 // VIRTUAL METHODS - Body may be edited by hand.
20 
21 NO_SANITIZE("cfi-icall")
ExecuteCommand(CefRefPtr<CefMenuModel> menu_model,int command_id,cef_event_flags_t event_flags)22 void CefMenuModelDelegateCToCpp::ExecuteCommand(
23     CefRefPtr<CefMenuModel> menu_model,
24     int command_id,
25     cef_event_flags_t event_flags) {
26   shutdown_checker::AssertNotShutdown();
27 
28   cef_menu_model_delegate_t* _struct = GetStruct();
29   if (CEF_MEMBER_MISSING(_struct, execute_command))
30     return;
31 
32   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
33 
34   // Verify param: menu_model; type: refptr_diff
35   DCHECK(menu_model.get());
36   if (!menu_model.get())
37     return;
38 
39   // Execute
40   _struct->execute_command(_struct, CefMenuModelCppToC::Wrap(menu_model),
41                            command_id, event_flags);
42 }
43 
44 NO_SANITIZE("cfi-icall")
MouseOutsideMenu(CefRefPtr<CefMenuModel> menu_model,const CefPoint & screen_point)45 void CefMenuModelDelegateCToCpp::MouseOutsideMenu(
46     CefRefPtr<CefMenuModel> menu_model,
47     const CefPoint& screen_point) {
48   shutdown_checker::AssertNotShutdown();
49 
50   cef_menu_model_delegate_t* _struct = GetStruct();
51   if (CEF_MEMBER_MISSING(_struct, mouse_outside_menu))
52     return;
53 
54   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
55 
56   // Verify param: menu_model; type: refptr_diff
57   DCHECK(menu_model.get());
58   if (!menu_model.get())
59     return;
60 
61   // Execute
62   _struct->mouse_outside_menu(_struct, CefMenuModelCppToC::Wrap(menu_model),
63                               &screen_point);
64 }
65 
66 NO_SANITIZE("cfi-icall")
UnhandledOpenSubmenu(CefRefPtr<CefMenuModel> menu_model,bool is_rtl)67 void CefMenuModelDelegateCToCpp::UnhandledOpenSubmenu(
68     CefRefPtr<CefMenuModel> menu_model,
69     bool is_rtl) {
70   shutdown_checker::AssertNotShutdown();
71 
72   cef_menu_model_delegate_t* _struct = GetStruct();
73   if (CEF_MEMBER_MISSING(_struct, unhandled_open_submenu))
74     return;
75 
76   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
77 
78   // Verify param: menu_model; type: refptr_diff
79   DCHECK(menu_model.get());
80   if (!menu_model.get())
81     return;
82 
83   // Execute
84   _struct->unhandled_open_submenu(_struct, CefMenuModelCppToC::Wrap(menu_model),
85                                   is_rtl);
86 }
87 
88 NO_SANITIZE("cfi-icall")
UnhandledCloseSubmenu(CefRefPtr<CefMenuModel> menu_model,bool is_rtl)89 void CefMenuModelDelegateCToCpp::UnhandledCloseSubmenu(
90     CefRefPtr<CefMenuModel> menu_model,
91     bool is_rtl) {
92   shutdown_checker::AssertNotShutdown();
93 
94   cef_menu_model_delegate_t* _struct = GetStruct();
95   if (CEF_MEMBER_MISSING(_struct, unhandled_close_submenu))
96     return;
97 
98   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
99 
100   // Verify param: menu_model; type: refptr_diff
101   DCHECK(menu_model.get());
102   if (!menu_model.get())
103     return;
104 
105   // Execute
106   _struct->unhandled_close_submenu(
107       _struct, CefMenuModelCppToC::Wrap(menu_model), is_rtl);
108 }
109 
110 NO_SANITIZE("cfi-icall")
MenuWillShow(CefRefPtr<CefMenuModel> menu_model)111 void CefMenuModelDelegateCToCpp::MenuWillShow(
112     CefRefPtr<CefMenuModel> menu_model) {
113   shutdown_checker::AssertNotShutdown();
114 
115   cef_menu_model_delegate_t* _struct = GetStruct();
116   if (CEF_MEMBER_MISSING(_struct, menu_will_show))
117     return;
118 
119   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
120 
121   // Verify param: menu_model; type: refptr_diff
122   DCHECK(menu_model.get());
123   if (!menu_model.get())
124     return;
125 
126   // Execute
127   _struct->menu_will_show(_struct, CefMenuModelCppToC::Wrap(menu_model));
128 }
129 
130 NO_SANITIZE("cfi-icall")
MenuClosed(CefRefPtr<CefMenuModel> menu_model)131 void CefMenuModelDelegateCToCpp::MenuClosed(
132     CefRefPtr<CefMenuModel> menu_model) {
133   shutdown_checker::AssertNotShutdown();
134 
135   cef_menu_model_delegate_t* _struct = GetStruct();
136   if (CEF_MEMBER_MISSING(_struct, menu_closed))
137     return;
138 
139   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
140 
141   // Verify param: menu_model; type: refptr_diff
142   DCHECK(menu_model.get());
143   if (!menu_model.get())
144     return;
145 
146   // Execute
147   _struct->menu_closed(_struct, CefMenuModelCppToC::Wrap(menu_model));
148 }
149 
150 NO_SANITIZE("cfi-icall")
FormatLabel(CefRefPtr<CefMenuModel> menu_model,CefString & label)151 bool CefMenuModelDelegateCToCpp::FormatLabel(CefRefPtr<CefMenuModel> menu_model,
152                                              CefString& label) {
153   shutdown_checker::AssertNotShutdown();
154 
155   cef_menu_model_delegate_t* _struct = GetStruct();
156   if (CEF_MEMBER_MISSING(_struct, format_label))
157     return false;
158 
159   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
160 
161   // Verify param: menu_model; type: refptr_diff
162   DCHECK(menu_model.get());
163   if (!menu_model.get())
164     return false;
165 
166   // Execute
167   int _retval = _struct->format_label(
168       _struct, CefMenuModelCppToC::Wrap(menu_model), label.GetWritableStruct());
169 
170   // Return type: bool
171   return _retval ? true : false;
172 }
173 
174 // CONSTRUCTOR - Do not edit by hand.
175 
CefMenuModelDelegateCToCpp()176 CefMenuModelDelegateCToCpp::CefMenuModelDelegateCToCpp() {}
177 
178 // DESTRUCTOR - Do not edit by hand.
179 
~CefMenuModelDelegateCToCpp()180 CefMenuModelDelegateCToCpp::~CefMenuModelDelegateCToCpp() {
181   shutdown_checker::AssertNotShutdown();
182 }
183 
184 template <>
185 cef_menu_model_delegate_t* CefCToCppRefCounted<
186     CefMenuModelDelegateCToCpp,
187     CefMenuModelDelegate,
UnwrapDerived(CefWrapperType type,CefMenuModelDelegate * c)188     cef_menu_model_delegate_t>::UnwrapDerived(CefWrapperType type,
189                                               CefMenuModelDelegate* c) {
190   NOTREACHED() << "Unexpected class type: " << type;
191   return nullptr;
192 }
193 
194 template <>
195 CefWrapperType CefCToCppRefCounted<CefMenuModelDelegateCToCpp,
196                                    CefMenuModelDelegate,
197                                    cef_menu_model_delegate_t>::kWrapperType =
198     WT_MENU_MODEL_DELEGATE;
199