本文整理汇总了C++中CefRefPtr::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CefRefPtr::Clear方法的具体用法?C++ CefRefPtr::Clear怎么用?C++ CefRefPtr::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CefRefPtr
的用法示例。
在下文中一共展示了CefRefPtr::Clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBeforeContextMenu
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);
}
}
示例2: OnBeforeContextMenu
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();//Çå³ýÓÒ¼ü²Ëµ¥
}
示例3: OnBeforeContextMenu
void ClientHandler::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefContextMenuParams> params,
CefRefPtr<CefMenuModel> model)
{
#ifndef _DEBUG
//Empty context menu
model->Clear();
#endif
}
示例4: OnBeforeContextMenu
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();
}
示例5: OnBeforeContextMenu
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();
}