github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/capi/cef_web_plugin_capi.h (about)

     1  // Copyright (c) 2014 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  
    37  #ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
    38  #define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_
    39  #pragma once
    40  
    41  #ifdef __cplusplus
    42  extern "C" {
    43  #endif
    44  
    45  #include "include/capi/cef_base_capi.h"
    46  #include "include/capi/cef_browser_capi.h"
    47  
    48  
    49  ///
    50  // Information about a specific web plugin.
    51  ///
    52  typedef struct _cef_web_plugin_info_t {
    53    ///
    54    // Base structure.
    55    ///
    56    cef_base_t base;
    57  
    58    ///
    59    // Returns the plugin name (i.e. Flash).
    60    ///
    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);
    64  
    65    ///
    66    // Returns the plugin file path (DLL/bundle/library).
    67    ///
    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);
    71  
    72    ///
    73    // Returns the version of the plugin (may be OS-specific).
    74    ///
    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);
    78  
    79    ///
    80    // Returns a description of the plugin from the version information.
    81    ///
    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;
    86  
    87  
    88  ///
    89  // Structure to implement for visiting web plugin information. The functions of
    90  // this structure will be called on the browser process UI thread.
    91  ///
    92  typedef struct _cef_web_plugin_info_visitor_t {
    93    ///
    94    // Base structure.
    95    ///
    96    cef_base_t base;
    97  
    98    ///
    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.
   103    ///
   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;
   107  
   108  
   109  ///
   110  // Structure to implement for receiving unstable plugin information. The
   111  // functions of this structure will be called on the browser process IO thread.
   112  ///
   113  typedef struct _cef_web_plugin_unstable_callback_t {
   114    ///
   115    // Base structure.
   116    ///
   117    cef_base_t base;
   118  
   119    ///
   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
   122    // 120 seconds.
   123    ///
   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;
   128  
   129  
   130  ///
   131  // Visit web plugin information. Can be called on any thread in the browser
   132  // process.
   133  ///
   134  CEF_EXPORT void cef_visit_web_plugin_info(
   135      cef_web_plugin_info_visitor_t* visitor);
   136  
   137  ///
   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
   140  // browser process.
   141  ///
   142  CEF_EXPORT void cef_refresh_web_plugins();
   143  
   144  ///
   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
   147  // browser process.
   148  ///
   149  CEF_EXPORT void cef_add_web_plugin_path(const cef_string_t* path);
   150  
   151  ///
   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
   154  // browser process.
   155  ///
   156  CEF_EXPORT void cef_add_web_plugin_directory(const cef_string_t* dir);
   157  
   158  ///
   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.
   162  ///
   163  CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path);
   164  
   165  ///
   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
   168  // browser process.
   169  ///
   170  CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path);
   171  
   172  ///
   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.
   175  ///
   176  CEF_EXPORT void cef_force_web_plugin_shutdown(const cef_string_t* path);
   177  
   178  ///
   179  // Register a plugin crash. Can be called on any thread in the browser process
   180  // but will be executed on the IO thread.
   181  ///
   182  CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path);
   183  
   184  ///
   185  // Query if a plugin is unstable. Can be called on any thread in the browser
   186  // process.
   187  ///
   188  CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path,
   189      cef_web_plugin_unstable_callback_t* callback);
   190  
   191  #ifdef __cplusplus
   192  }
   193  #endif
   194  
   195  #endif  // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_