Add plugin placeholder and policy support (issue #1708)

- Default plugin loading policy can be specified using the new
  `--plugin-policy=[allow|block|detect]` command-line flag.
- Move CefRequestHandler::OnBeforePluginLoad to
  CefRequestContextHandler and add a new policy argument that
  supports different actions (allow, block, detect, disable) on a
  per-plugin-instance basis.
- Add CefContextMenuHandler::RunContextMenu for providing a custom
  context menu implementation.
- Add CefResourceBundleHandler::GetDataResourceForScale for
  returning scaled resources (issue #1272).
- Add CefResourceBundle for retrieving resources from the resource
  bundle (*.pak) files loaded by CEF during startup or via the
  CefResourceBundleHandler.
- Linux: Fix Debug build IO access warning with CefGetMimeType.
- cef_unittests: Move the refcounting implementation from TestHandler
  to subclasses in order to support interface inheritance from
  subclasses.
This commit is contained in:
Marshall Greenblatt
2015-09-09 16:05:39 +02:00
parent 846107b291
commit dc3aae19e8
114 changed files with 4007 additions and 559 deletions

View File

@ -40,6 +40,7 @@
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_cookie_capi.h"
#include "include/capi/cef_web_plugin_capi.h"
#ifdef __cplusplus
extern "C" {
@ -58,12 +59,30 @@ typedef struct _cef_request_context_handler_t {
cef_base_t base;
///
// Called on the IO thread to retrieve the cookie manager. If this function
// returns NULL the default cookie manager retrievable via
// Called on the browser process IO thread to retrieve the cookie manager. If
// this function returns NULL the default cookie manager retrievable via
// cef_request_tContext::get_default_cookie_manager() will be used.
///
struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)(
struct _cef_request_context_handler_t* self);
///
// Called on the browser process IO thread before a plugin instance is loaded.
// |mime_type| is the mime type of the plugin that will be loaded.
// |plugin_url| is the content URL that the plugin will load and may be NULL.
// |top_origin_url| is the URL for the top-level frame that contains the
// plugin. |plugin_info| includes additional information about the plugin that
// will be loaded. |plugin_policy| is the recommended policy. Modify
// |plugin_policy| and return true (1) to change the policy. Return false (0)
// to use the recommended policy. The default plugin policy can be set at
// runtime using the `--plugin-policy=[allow|detect|block]` command-line flag.
///
int (CEF_CALLBACK *on_before_plugin_load)(
struct _cef_request_context_handler_t* self,
const cef_string_t* mime_type, const cef_string_t* plugin_url,
const cef_string_t* top_origin_url,
struct _cef_web_plugin_info_t* plugin_info,
cef_plugin_policy_t* plugin_policy);
} cef_request_context_handler_t;