Ejemplo n.º 1
0
        // void (*)(_cef_context_menu_handler_t* self, _cef_browser_t* browser, _cef_frame_t* frame, _cef_context_menu_params_t* params, _cef_menu_model_t* model)*
        private static unsafe void OnBeforeContextMenuImpl(cef_context_menu_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_context_menu_params_t * @params, cef_menu_model_t *model)
        {
            var instance = GetInstance((IntPtr)self) as CefContextMenuHandler;

            if (instance == null || ((ICefContextMenuHandlerPrivate)instance).AvoidOnBeforeContextMenu())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)browser);
                ReleaseIfNonNull((cef_base_ref_counted_t *)frame);
                ReleaseIfNonNull((cef_base_ref_counted_t *)@params);
                ReleaseIfNonNull((cef_base_ref_counted_t *)model);
                return;
            }
            instance.OnBeforeContextMenu(CefBrowser.Wrap(CefBrowser.Create, browser), CefFrame.Wrap(CefFrame.Create, frame), CefContextMenuParams.Wrap(CefContextMenuParams.Create, @params), CefMenuModel.Wrap(CefMenuModel.Create, model));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Called to allow custom display of the context menu. |params| provides
 /// information about the context menu state. |model| contains the context menu
 /// model resulting from OnBeforeContextMenu. For custom display return true
 /// (1) and execute |callback| either synchronously or asynchronously with the
 /// selected command ID. For default display return false (0). Do not keep
 /// references to |params| or |model| outside of this callback.
 /// </summary>
 protected internal unsafe virtual bool RunContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams @params, CefMenuModel model, CefRunContextMenuCallback callback)
 {
     return(default);
Ejemplo n.º 3
0
 /// <summary>
 /// Called before a context menu is displayed. |params| provides information
 /// about the context menu state. |model| initially contains the default
 /// context menu. The |model| can be cleared to show no context menu or
 /// modified to show a custom menu. Do not keep references to |params| or
 /// |model| outside of this callback.
 /// </summary>
 protected internal unsafe virtual void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams @params, CefMenuModel model)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Called before a context menu is displayed. |params| provides information
 /// about the context menu state. |model| initially contains the default
 /// context menu. The |model| can be cleared to show no context menu or
 /// modified to show a custom menu. Do not keep references to |params| or
 /// |model| outside of this callback.
 /// </summary>
 public unsafe virtual void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams @params, CefMenuModel model)
 {
 }