void ClientHandler::OnBeforeContextMenu( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefContextMenuParams> params, CefRefPtr<CefMenuModel> model) { // Henry if(!AllowMouseRightClick) { model->Clear(); return; } if ((params->GetTypeFlags() & (CM_TYPEFLAG_PAGE | CM_TYPEFLAG_FRAME)) != 0) { // Add a separator if the menu already has items. if (model->GetCount() > 0) model->AddSeparator(); // Add a "Show DevTools" item to all context menus. model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools"); CefString devtools_url = browser->GetHost()->GetDevToolsURL(true); if (devtools_url.empty() || m_OpenDevToolsURLs.find(devtools_url) != m_OpenDevToolsURLs.end()) { // Disable the menu option if DevTools isn't enabled or if a window is // already open for the current URL. model->SetEnabled(CLIENT_ID_SHOW_DEVTOOLS, false); } // Test context menu features. BuildTestMenu(model); } }
void CefClientImpl::OnBeforeContextMenu( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefContextMenuParams> params, CefRefPtr<CefMenuModel> model) { CEF_REQUIRE_UI_THREAD(); //http://blog.sina.com.cn/s/blog_dad2c54101019cwb.html model->Clear();//Çå³ýÓÒ¼ü²Ëµ¥ }
void ClientHandler::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefContextMenuParams> params, CefRefPtr<CefMenuModel> model) { #ifndef _DEBUG //Empty context menu model->Clear(); #endif }
void BrowserClient::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefContextMenuParams> params, CefRefPtr<CefMenuModel> model) { (void)browser; (void)frame; (void)params; // remove all context menu contributions model->Clear(); }
void ContextMenuHandler::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefContextMenuParams> params, CefRefPtr<CefMenuModel> model) { if (!GetCallback()) return; ChromiumDLL::RefPtr<ChromiumDLL::ChromiumMenuInfoI> cmi = new ChromiumMenuInfo(params, GetBrowser()->GetHost()->GetWindowHandle()); if (GetCallback()->handlePopupMenu(cmi)) model->Clear(); }
void WebRendererHandler::OnBeforeContextMenu(CefRefPtr<CefBrowser> p_Browser, CefRefPtr<CefFrame> p_Frame, CefRefPtr<CefContextMenuParams> p_Params, CefRefPtr<CefMenuModel> p_Model) { // Disallow context menus p_Model->Clear(); }