mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@ -15,6 +15,7 @@
|
||||
#include "libcef_dll/ctocpp/context_menu_params_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/menu_model_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h"
|
||||
|
||||
|
||||
namespace {
|
||||
@ -55,6 +56,49 @@ void CEF_CALLBACK context_menu_handler_on_before_context_menu(
|
||||
CefMenuModelCToCpp::Wrap(model));
|
||||
}
|
||||
|
||||
int CEF_CALLBACK context_menu_handler_run_context_menu(
|
||||
struct _cef_context_menu_handler_t* self, cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
|
||||
struct _cef_menu_model_t* model,
|
||||
cef_run_context_menu_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return 0;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return 0;
|
||||
// Verify param: params; type: refptr_diff
|
||||
DCHECK(params);
|
||||
if (!params)
|
||||
return 0;
|
||||
// Verify param: model; type: refptr_diff
|
||||
DCHECK(model);
|
||||
if (!model)
|
||||
return 0;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback);
|
||||
if (!callback)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefContextMenuHandlerCppToC::Get(self)->RunContextMenu(
|
||||
CefBrowserCToCpp::Wrap(browser),
|
||||
CefFrameCToCpp::Wrap(frame),
|
||||
CefContextMenuParamsCToCpp::Wrap(params),
|
||||
CefMenuModelCToCpp::Wrap(model),
|
||||
CefRunContextMenuCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK context_menu_handler_on_context_menu_command(
|
||||
struct _cef_context_menu_handler_t* self, cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params,
|
||||
@ -120,6 +164,7 @@ void CEF_CALLBACK context_menu_handler_on_context_menu_dismissed(
|
||||
CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC() {
|
||||
GetStruct()->on_before_context_menu =
|
||||
context_menu_handler_on_before_context_menu;
|
||||
GetStruct()->run_context_menu = context_menu_handler_run_context_menu;
|
||||
GetStruct()->on_context_menu_command =
|
||||
context_menu_handler_on_context_menu_command;
|
||||
GetStruct()->on_context_menu_dismissed =
|
||||
|
Reference in New Issue
Block a user