本文整理汇总了C++中CefRefPtr::GetFrameCharset方法的典型用法代码示例。如果您正苦于以下问题:C++ CefRefPtr::GetFrameCharset方法的具体用法?C++ CefRefPtr::GetFrameCharset怎么用?C++ CefRefPtr::GetFrameCharset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CefRefPtr
的用法示例。
在下文中一共展示了CefRefPtr::GetFrameCharset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NewJNIString
JNIEXPORT jstring JNICALL Java_org_cef_callback_CefContextMenuParams_1N_N_1GetFrameCharset
(JNIEnv *env, jobject obj) {
CefRefPtr<CefContextMenuParams> menuParams =
GetCefFromJNIObject<CefContextMenuParams>(env, obj, "CefContextMenuParams");
if (!menuParams.get())
return NULL;
return NewJNIString(env, menuParams->GetFrameCharset());
}
示例2: OnBeforeContextMenu
void CBrowerDialogContextMenu::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefContextMenuParams> params,
CefRefPtr<CefMenuModel> model)
{
std::string url = params->GetLinkUrl().ToString();
if (!url.empty())
{
model->InsertItemAt(0, CLIENT_ID_OPEN_SELECTED_SIDE, kodi::GetLocalizedString(30000 + CLIENT_ID_OPEN_SELECTED_SIDE));
if (!m_client->IsFullscreen())
model->InsertItemAt(0, CLIENT_ID_OPEN_SELECTED_SIDE_IN_NEW_TAB, kodi::GetLocalizedString(30000 + CLIENT_ID_OPEN_SELECTED_SIDE_IN_NEW_TAB));
}
int flags = params->GetTypeFlags();
if (flags & CM_TYPEFLAG_EDITABLE)
model->InsertItemAt(0, CLIENT_ID_OPEN_KEYBOARD, kodi::GetLocalizedString(30000 + CLIENT_ID_OPEN_KEYBOARD));
#ifdef DEBUG_LOGS
LOG_MESSAGE(ADDON_LOG_DEBUG, "CefContextMenuParams");
LOG_MESSAGE(ADDON_LOG_DEBUG, "- %ix%i - TypeFlags: 0x%X - ImageContents: %s - MediaType: %i - MediaStateFlags %i - EditStateFlags %i", params->GetXCoord(),
params->GetYCoord(), (int)params->GetTypeFlags(), params->HasImageContents() ? "yes" : "no",
(int)params->GetMediaType(), (int)params->GetMediaStateFlags(), (int)params->GetEditStateFlags());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- LinkUrl: %s", params->GetLinkUrl().ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- UnfilteredLinkUrl: %s", params->GetUnfilteredLinkUrl().ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- SourceUrl: %s", params->GetSourceUrl().ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- PageUrl: %s", params->GetPageUrl().ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- FrameUrl : %s", params->GetFrameUrl().ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- FrameCharset : %s", params->GetFrameCharset().ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- SelectionText : %s", params->GetSelectionText().ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- MisspelledWord : %s", params->GetMisspelledWord().ToString().c_str());
std::vector<CefString> suggestions;
LOG_MESSAGE(ADDON_LOG_DEBUG, "- DictionarySuggestions : %s", params->GetDictionarySuggestions(suggestions) ? "OK" : "fail");
for (unsigned int i = 0; i < suggestions.size(); i++)
LOG_MESSAGE(ADDON_LOG_DEBUG, " - %02i: %s", i, suggestions[i].ToString().c_str());
LOG_MESSAGE(ADDON_LOG_DEBUG, "- IsEditable : %s", params->IsEditable() ? "yes" : "no");
LOG_MESSAGE(ADDON_LOG_DEBUG, "- IsSpellCheckEnabled : %s", params->IsSpellCheckEnabled() ? "yes" : "no");
LOG_MESSAGE(ADDON_LOG_DEBUG, "- IsCustomMenu : %s", params->IsCustomMenu() ? "yes" : "no");
LOG_MESSAGE(ADDON_LOG_DEBUG, "- IsPepperMenu : %s", params->IsPepperMenu() ? "yes" : "no");
LOG_MESSAGE(ADDON_LOG_DEBUG, "CefMenuModel");
LOG_MESSAGE(ADDON_LOG_DEBUG, "- Count: %i", model->GetCount());
for (int i = 0; i < model->GetCount(); i++)
LOG_MESSAGE(ADDON_LOG_DEBUG, " - %02i: ID '%i' Type '%i' - Name '%s'",
i, model->GetCommandIdAt(i), model->GetTypeAt(i), model->GetLabelAt(i).ToString().c_str());
#endif
}