1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 7 // * Redistributions of source code must retain the above copyright 8 // notice, this list of conditions and the following disclaimer. 9 // * Redistributions in binary form must reproduce the above 10 // copyright notice, this list of conditions and the following disclaimer 11 // in the documentation and/or other materials provided with the 12 // distribution. 13 // * Neither the name of Google Inc. nor the name Chromium Embedded 14 // Framework nor the names of its contributors may be used to endorse 15 // or promote products derived from this software without specific prior 16 // written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // 30 // --------------------------------------------------------------------------- 31 // 32 // This file was generated by the CEF translator tool and should not edited 33 // by hand. See the translator.README.txt file in the tools directory for 34 // more information. 35 // 36 // $hash=51060280dee57104eaef7b774e4b4895970c0057$ 37 // 38 39 #ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ 40 #define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ 41 #pragma once 42 43 #include "include/capi/cef_base_capi.h" 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 struct _cef_browser_t; 50 51 /// 52 // Information about a specific web plugin. 53 /// 54 typedef struct _cef_web_plugin_info_t { 55 /// 56 // Base structure. 57 /// 58 cef_base_ref_counted_t base; 59 60 /// 61 // Returns the plugin name. 62 /// 63 // The resulting string must be freed by calling cef_string_userfree_free(). 64 cef_string_userfree_t(CEF_CALLBACK* get_name)( 65 struct _cef_web_plugin_info_t* self); 66 67 /// 68 // Returns the plugin file path (DLL/bundle/library). 69 /// 70 // The resulting string must be freed by calling cef_string_userfree_free(). 71 cef_string_userfree_t(CEF_CALLBACK* get_path)( 72 struct _cef_web_plugin_info_t* self); 73 74 /// 75 // Returns the version of the plugin (may be OS-specific). 76 /// 77 // The resulting string must be freed by calling cef_string_userfree_free(). 78 cef_string_userfree_t(CEF_CALLBACK* get_version)( 79 struct _cef_web_plugin_info_t* self); 80 81 /// 82 // Returns a description of the plugin from the version information. 83 /// 84 // The resulting string must be freed by calling cef_string_userfree_free(). 85 cef_string_userfree_t(CEF_CALLBACK* get_description)( 86 struct _cef_web_plugin_info_t* self); 87 } cef_web_plugin_info_t; 88 89 /// 90 // Structure to implement for visiting web plugin information. The functions of 91 // this structure will be called on the browser process UI thread. 92 /// 93 typedef struct _cef_web_plugin_info_visitor_t { 94 /// 95 // Base structure. 96 /// 97 cef_base_ref_counted_t base; 98 99 /// 100 // Method that will be called once for each plugin. |count| is the 0-based 101 // index for the current plugin. |total| is the total number of plugins. 102 // Return false (0) to stop visiting plugins. This function may never be 103 // called if no plugins are found. 104 /// 105 int(CEF_CALLBACK* visit)(struct _cef_web_plugin_info_visitor_t* self, 106 struct _cef_web_plugin_info_t* info, 107 int count, 108 int total); 109 } cef_web_plugin_info_visitor_t; 110 111 /// 112 // Structure to implement for receiving unstable plugin information. The 113 // functions of this structure will be called on the browser process IO thread. 114 /// 115 typedef struct _cef_web_plugin_unstable_callback_t { 116 /// 117 // Base structure. 118 /// 119 cef_base_ref_counted_t base; 120 121 /// 122 // Method that will be called for the requested plugin. |unstable| will be 123 // true (1) if the plugin has reached the crash count threshold of 3 times in 124 // 120 seconds. 125 /// 126 void(CEF_CALLBACK* is_unstable)( 127 struct _cef_web_plugin_unstable_callback_t* self, 128 const cef_string_t* path, 129 int unstable); 130 } cef_web_plugin_unstable_callback_t; 131 132 /// 133 // Visit web plugin information. Can be called on any thread in the browser 134 // process. 135 /// 136 CEF_EXPORT void cef_visit_web_plugin_info( 137 cef_web_plugin_info_visitor_t* visitor); 138 139 /// 140 // Cause the plugin list to refresh the next time it is accessed regardless of 141 // whether it has already been loaded. Can be called on any thread in the 142 // browser process. 143 /// 144 CEF_EXPORT void cef_refresh_web_plugins(); 145 146 /// 147 // Unregister an internal plugin. This may be undone the next time 148 // cef_refresh_web_plugins() is called. Can be called on any thread in the 149 // browser process. 150 /// 151 CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path); 152 153 /// 154 // Register a plugin crash. Can be called on any thread in the browser process 155 // but will be executed on the IO thread. 156 /// 157 CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path); 158 159 /// 160 // Query if a plugin is unstable. Can be called on any thread in the browser 161 // process. 162 /// 163 CEF_EXPORT void cef_is_web_plugin_unstable( 164 const cef_string_t* path, 165 cef_web_plugin_unstable_callback_t* callback); 166 167 #ifdef __cplusplus 168 } 169 #endif 170 171 #endif // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ 172