• 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=a62aa669321b0f86ea3508ce31ea5b1a0bc3f9b5$
13 //
14 
15 #include "libcef_dll/ctocpp/resource_bundle_ctocpp.h"
16 #include "libcef_dll/ctocpp/binary_value_ctocpp.h"
17 
18 // STATIC METHODS - Body may be edited by hand.
19 
20 NO_SANITIZE("cfi-icall")
GetGlobal()21 CefRefPtr<CefResourceBundle> CefResourceBundle::GetGlobal() {
22   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
23 
24   // Execute
25   cef_resource_bundle_t* _retval = cef_resource_bundle_get_global();
26 
27   // Return type: refptr_same
28   return CefResourceBundleCToCpp::Wrap(_retval);
29 }
30 
31 // VIRTUAL METHODS - Body may be edited by hand.
32 
33 NO_SANITIZE("cfi-icall")
GetLocalizedString(int string_id)34 CefString CefResourceBundleCToCpp::GetLocalizedString(int string_id) {
35   cef_resource_bundle_t* _struct = GetStruct();
36   if (CEF_MEMBER_MISSING(_struct, get_localized_string))
37     return CefString();
38 
39   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
40 
41   // Execute
42   cef_string_userfree_t _retval =
43       _struct->get_localized_string(_struct, string_id);
44 
45   // Return type: string
46   CefString _retvalStr;
47   _retvalStr.AttachToUserFree(_retval);
48   return _retvalStr;
49 }
50 
51 NO_SANITIZE("cfi-icall")
GetDataResource(int resource_id)52 CefRefPtr<CefBinaryValue> CefResourceBundleCToCpp::GetDataResource(
53     int resource_id) {
54   cef_resource_bundle_t* _struct = GetStruct();
55   if (CEF_MEMBER_MISSING(_struct, get_data_resource))
56     return nullptr;
57 
58   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
59 
60   // Execute
61   cef_binary_value_t* _retval =
62       _struct->get_data_resource(_struct, resource_id);
63 
64   // Return type: refptr_same
65   return CefBinaryValueCToCpp::Wrap(_retval);
66 }
67 
68 NO_SANITIZE("cfi-icall")
GetDataResourceForScale(int resource_id,ScaleFactor scale_factor)69 CefRefPtr<CefBinaryValue> CefResourceBundleCToCpp::GetDataResourceForScale(
70     int resource_id,
71     ScaleFactor scale_factor) {
72   cef_resource_bundle_t* _struct = GetStruct();
73   if (CEF_MEMBER_MISSING(_struct, get_data_resource_for_scale))
74     return nullptr;
75 
76   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
77 
78   // Execute
79   cef_binary_value_t* _retval =
80       _struct->get_data_resource_for_scale(_struct, resource_id, scale_factor);
81 
82   // Return type: refptr_same
83   return CefBinaryValueCToCpp::Wrap(_retval);
84 }
85 
86 // CONSTRUCTOR - Do not edit by hand.
87 
CefResourceBundleCToCpp()88 CefResourceBundleCToCpp::CefResourceBundleCToCpp() {}
89 
90 // DESTRUCTOR - Do not edit by hand.
91 
~CefResourceBundleCToCpp()92 CefResourceBundleCToCpp::~CefResourceBundleCToCpp() {}
93 
94 template <>
95 cef_resource_bundle_t* CefCToCppRefCounted<
96     CefResourceBundleCToCpp,
97     CefResourceBundle,
UnwrapDerived(CefWrapperType type,CefResourceBundle * c)98     cef_resource_bundle_t>::UnwrapDerived(CefWrapperType type,
99                                           CefResourceBundle* c) {
100   NOTREACHED() << "Unexpected class type: " << type;
101   return nullptr;
102 }
103 
104 template <>
105 CefWrapperType CefCToCppRefCounted<CefResourceBundleCToCpp,
106                                    CefResourceBundle,
107                                    cef_resource_bundle_t>::kWrapperType =
108     WT_RESOURCE_BUNDLE;
109