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=ee267b6567062246b9f82b4b50b68d82d2cc939f$
13 //
14
15 #include "libcef_dll/cpptoc/app_cpptoc.h"
16 #include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
17 #include "libcef_dll/cpptoc/render_process_handler_cpptoc.h"
18 #include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h"
19 #include "libcef_dll/ctocpp/command_line_ctocpp.h"
20 #include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h"
21
22 namespace {
23
24 // MEMBER FUNCTIONS - Body may be edited by hand.
25
app_on_before_command_line_processing(struct _cef_app_t * self,const cef_string_t * process_type,struct _cef_command_line_t * command_line)26 void CEF_CALLBACK app_on_before_command_line_processing(
27 struct _cef_app_t* self,
28 const cef_string_t* process_type,
29 struct _cef_command_line_t* command_line) {
30 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
31
32 DCHECK(self);
33 if (!self)
34 return;
35 // Verify param: command_line; type: refptr_diff
36 DCHECK(command_line);
37 if (!command_line)
38 return;
39 // Unverified params: process_type
40
41 // Execute
42 CefAppCppToC::Get(self)->OnBeforeCommandLineProcessing(
43 CefString(process_type), CefCommandLineCToCpp::Wrap(command_line));
44 }
45
46 void CEF_CALLBACK
app_on_register_custom_schemes(struct _cef_app_t * self,struct _cef_scheme_registrar_t * registrar)47 app_on_register_custom_schemes(struct _cef_app_t* self,
48 struct _cef_scheme_registrar_t* registrar) {
49 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
50
51 DCHECK(self);
52 if (!self)
53 return;
54 // Verify param: registrar; type: rawptr_diff
55 DCHECK(registrar);
56 if (!registrar)
57 return;
58
59 // Translate param: registrar; type: rawptr_diff
60 CefOwnPtr<CefSchemeRegistrar> registrarPtr(
61 CefSchemeRegistrarCToCpp::Wrap(registrar));
62
63 // Execute
64 CefAppCppToC::Get(self)->OnRegisterCustomSchemes(registrarPtr.get());
65 }
66
67 struct _cef_resource_bundle_handler_t* CEF_CALLBACK
app_get_resource_bundle_handler(struct _cef_app_t * self)68 app_get_resource_bundle_handler(struct _cef_app_t* self) {
69 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
70
71 DCHECK(self);
72 if (!self)
73 return NULL;
74
75 // Execute
76 CefRefPtr<CefResourceBundleHandler> _retval =
77 CefAppCppToC::Get(self)->GetResourceBundleHandler();
78
79 // Return type: refptr_same
80 return CefResourceBundleHandlerCppToC::Wrap(_retval);
81 }
82
83 struct _cef_browser_process_handler_t* CEF_CALLBACK
app_get_browser_process_handler(struct _cef_app_t * self)84 app_get_browser_process_handler(struct _cef_app_t* self) {
85 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
86
87 DCHECK(self);
88 if (!self)
89 return NULL;
90
91 // Execute
92 CefRefPtr<CefBrowserProcessHandler> _retval =
93 CefAppCppToC::Get(self)->GetBrowserProcessHandler();
94
95 // Return type: refptr_same
96 return CefBrowserProcessHandlerCppToC::Wrap(_retval);
97 }
98
99 struct _cef_render_process_handler_t* CEF_CALLBACK
app_get_render_process_handler(struct _cef_app_t * self)100 app_get_render_process_handler(struct _cef_app_t* self) {
101 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
102
103 DCHECK(self);
104 if (!self)
105 return NULL;
106
107 // Execute
108 CefRefPtr<CefRenderProcessHandler> _retval =
109 CefAppCppToC::Get(self)->GetRenderProcessHandler();
110
111 // Return type: refptr_same
112 return CefRenderProcessHandlerCppToC::Wrap(_retval);
113 }
114
115 } // namespace
116
117 // CONSTRUCTOR - Do not edit by hand.
118
CefAppCppToC()119 CefAppCppToC::CefAppCppToC() {
120 GetStruct()->on_before_command_line_processing =
121 app_on_before_command_line_processing;
122 GetStruct()->on_register_custom_schemes = app_on_register_custom_schemes;
123 GetStruct()->get_resource_bundle_handler = app_get_resource_bundle_handler;
124 GetStruct()->get_browser_process_handler = app_get_browser_process_handler;
125 GetStruct()->get_render_process_handler = app_get_render_process_handler;
126 }
127
128 // DESTRUCTOR - Do not edit by hand.
129
~CefAppCppToC()130 CefAppCppToC::~CefAppCppToC() {}
131
132 template <>
133 CefRefPtr<CefApp>
UnwrapDerived(CefWrapperType type,cef_app_t * s)134 CefCppToCRefCounted<CefAppCppToC, CefApp, cef_app_t>::UnwrapDerived(
135 CefWrapperType type,
136 cef_app_t* s) {
137 NOTREACHED() << "Unexpected class type: " << type;
138 return nullptr;
139 }
140
141 template <>
142 CefWrapperType
143 CefCppToCRefCounted<CefAppCppToC, CefApp, cef_app_t>::kWrapperType = WT_APP;
144