1 // Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
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
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.
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.
30 // ---------------------------------------------------------------------------
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
37 #ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
41 #include "include/capi/cef_base_capi.h"
42 #include "include/capi/cef_browser_capi.h"
50 // Information about a specific web plugin.
52 typedef struct _cef_web_plugin_info_t {
59 // Returns the plugin name (i.e. Flash).
61 // The resulting string must be freed by calling cef_string_userfree_free().
62 cef_string_userfree_t (CEF_CALLBACK *get_name)(
63 struct _cef_web_plugin_info_t* self);
66 // Returns the plugin file path (DLL/bundle/library).
68 // The resulting string must be freed by calling cef_string_userfree_free().
69 cef_string_userfree_t (CEF_CALLBACK *get_path)(
70 struct _cef_web_plugin_info_t* self);
73 // Returns the version of the plugin (may be OS-specific).
75 // The resulting string must be freed by calling cef_string_userfree_free().
76 cef_string_userfree_t (CEF_CALLBACK *get_version)(
77 struct _cef_web_plugin_info_t* self);
80 // Returns a description of the plugin from the version information.
82 // The resulting string must be freed by calling cef_string_userfree_free().
83 cef_string_userfree_t (CEF_CALLBACK *get_description)(
84 struct _cef_web_plugin_info_t* self);
85 } cef_web_plugin_info_t;
89 // Structure to implement for visiting web plugin information. The functions of
90 // this structure will be called on the browser process UI thread.
92 typedef struct _cef_web_plugin_info_visitor_t {
99 // Method that will be called once for each plugin. |count| is the 0-based
100 // index for the current plugin. |total| is the total number of plugins.
101 // Return false (0) to stop visiting plugins. This function may never be
102 // called if no plugins are found.
104 int (CEF_CALLBACK *visit)(struct _cef_web_plugin_info_visitor_t* self,
105 struct _cef_web_plugin_info_t* info, int count, int total);
106 } cef_web_plugin_info_visitor_t;
110 // Structure to implement for receiving unstable plugin information. The
111 // functions of this structure will be called on the browser process IO thread.
113 typedef struct _cef_web_plugin_unstable_callback_t {
120 // Method that will be called for the requested plugin. |unstable| will be
121 // true (1) if the plugin has reached the crash count threshold of 3 times in
124 void (CEF_CALLBACK *is_unstable)(
125 struct _cef_web_plugin_unstable_callback_t* self,
126 const cef_string_t* path, int unstable);
127 } cef_web_plugin_unstable_callback_t;
131 // Visit web plugin information. Can be called on any thread in the browser
134 CEF_EXPORT void cef_visit_web_plugin_info(
135 cef_web_plugin_info_visitor_t* visitor);
138 // Cause the plugin list to refresh the next time it is accessed regardless of
139 // whether it has already been loaded. Can be called on any thread in the
142 CEF_EXPORT void cef_refresh_web_plugins();
145 // Add a plugin path (directory + file). This change may not take affect until
146 // after cef_refresh_web_plugins() is called. Can be called on any thread in the
149 CEF_EXPORT void cef_add_web_plugin_path(const cef_string_t* path);
152 // Add a plugin directory. This change may not take affect until after
153 // cef_refresh_web_plugins() is called. Can be called on any thread in the
156 CEF_EXPORT void cef_add_web_plugin_directory(const cef_string_t* dir);
159 // Remove a plugin path (directory + file). This change may not take affect
160 // until after cef_refresh_web_plugins() is called. Can be called on any thread
161 // in the browser process.
163 CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path);
166 // Unregister an internal plugin. This may be undone the next time
167 // cef_refresh_web_plugins() is called. Can be called on any thread in the
170 CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path);
173 // Force a plugin to shutdown. Can be called on any thread in the browser
174 // process but will be executed on the IO thread.
176 CEF_EXPORT void cef_force_web_plugin_shutdown(const cef_string_t* path);
179 // Register a plugin crash. Can be called on any thread in the browser process
180 // but will be executed on the IO thread.
182 CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path);
185 // Query if a plugin is unstable. Can be called on any thread in the browser
188 CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path,
189 cef_web_plugin_unstable_callback_t* callback);
195 #endif // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_