コード例 #1
0
        private int run_context_menu(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, cef_run_context_menu_callback_t *callback)
        {
            CheckSelf(self);

            var mBrowser    = CefBrowser.FromNative(browser);
            var mFrame      = CefFrame.FromNative(frame);
            var mParameters = CefContextMenuParams.FromNative(@params);
            var mModel      = CefMenuModel.FromNative(model);
            var mCallback   = CefRunContextMenuCallback.FromNative(callback);
            var result      = RunContextMenu(mBrowser, mFrame, mParameters, mModel, mCallback);

            mParameters.Dispose();
            mModel.Dispose();

            return(result ? 1 : 0);
        }
コード例 #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
 /// and execute |callback| either synchronously or asynchronously with the
 /// selected command ID. For default display return false. Do not keep
 /// references to |params| or |model| outside of this callback.
 /// </summary>
 protected virtual bool RunContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams parameters, CefMenuModel model, CefRunContextMenuCallback callback)
 {
     return(false);
 }