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

@ -17,7 +17,6 @@
#include "libcef_dll/cpptoc/request_callback_cpptoc.h"
#include "libcef_dll/cpptoc/response_cpptoc.h"
#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
#include "libcef_dll/cpptoc/web_plugin_info_cpptoc.h"
#include "libcef_dll/ctocpp/request_handler_ctocpp.h"
#include "libcef_dll/ctocpp/resource_handler_ctocpp.h"
@ -375,36 +374,6 @@ bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr<CefBrowser> browser,
return _retval?true:false;
}
bool CefRequestHandlerCToCpp::OnBeforePluginLoad(CefRefPtr<CefBrowser> browser,
const CefString& url, const CefString& policy_url,
CefRefPtr<CefWebPluginInfo> info) {
cef_request_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_before_plugin_load))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: browser; type: refptr_diff
DCHECK(browser.get());
if (!browser.get())
return false;
// Verify param: info; type: refptr_diff
DCHECK(info.get());
if (!info.get())
return false;
// Unverified params: url, policy_url
// Execute
int _retval = _struct->on_before_plugin_load(_struct,
CefBrowserCppToC::Wrap(browser),
url.GetStruct(),
policy_url.GetStruct(),
CefWebPluginInfoCppToC::Wrap(info));
// Return type: bool
return _retval?true:false;
}
void CefRequestHandlerCToCpp::OnPluginCrashed(CefRefPtr<CefBrowser> browser,
const CefString& plugin_path) {
cef_request_handler_t* _struct = GetStruct();