本文整理汇总了C++中FrameLoader::canGoBackOrForward方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameLoader::canGoBackOrForward方法的具体用法?C++ FrameLoader::canGoBackOrForward怎么用?C++ FrameLoader::canGoBackOrForward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameLoader
的用法示例。
在下文中一共展示了FrameLoader::canGoBackOrForward方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: populate
//.........这里部分代码省略.........
KURL imageURL = result.absoluteImageURL();
if (!imageURL.isEmpty()) {
if (!linkURL.isEmpty())
appendItem(*separatorItem());
appendItem(OpenImageInNewWindowItem);
appendItem(DownloadImageItem);
if (imageURL.isLocalFile() || m_hitTestResult.image())
appendItem(CopyImageItem);
}
if (imageURL.isEmpty() && linkURL.isEmpty()) {
if (result.isSelected()) {
if (selectionContainsPossibleWord(frame)) {
#if PLATFORM(MAC)
appendItem(SearchSpotlightItem);
#endif
appendItem(SearchWebItem);
appendItem(*separatorItem());
#if PLATFORM(MAC)
appendItem(LookInDictionaryItem);
appendItem(*separatorItem());
#endif
}
appendItem(CopyItem);
} else {
#if PLATFORM(GTK)
appendItem(BackItem);
appendItem(ForwardItem);
appendItem(StopItem);
appendItem(ReloadItem);
#else
if (loader->canGoBackOrForward(-1))
appendItem(BackItem);
if (loader->canGoBackOrForward(1))
appendItem(ForwardItem);
// use isLoadingInAPISense rather than isLoading because Stop/Reload are
// intended to match WebKit's API, not WebCore's internal notion of loading status
if (loader->documentLoader()->isLoadingInAPISense())
appendItem(StopItem);
else
appendItem(ReloadItem);
#endif
if (frame->page() && frame != frame->page()->mainFrame())
appendItem(OpenFrameItem);
}
}
} else { // Make an editing context menu
SelectionController* selection = frame->selection();
bool inPasswordField = selection->isInPasswordField();
if (!inPasswordField) {
// Consider adding spelling-related or grammar-related context menu items (never both, since a single selected range
// is never considered a misspelling and bad grammar at the same time)
bool misspelling = frame->editor()->isSelectionMisspelled();
bool badGrammar = !misspelling && (frame->editor()->isGrammarCheckingEnabled() && frame->editor()->isSelectionUngrammatical());
if (misspelling || badGrammar) {
Vector<String> guesses = misspelling ? frame->editor()->guessesForMisspelledSelection()
: frame->editor()->guessesForUngrammaticalSelection();
size_t size = guesses.size();
if (size == 0) {