本文整理汇总了C++中SelectionController::isInPasswordField方法的典型用法代码示例。如果您正苦于以下问题:C++ SelectionController::isInPasswordField方法的具体用法?C++ SelectionController::isInPasswordField怎么用?C++ SelectionController::isInPasswordField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectionController
的用法示例。
在下文中一共展示了SelectionController::isInPasswordField方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: populate
//.........这里部分代码省略.........
#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) {
// If there's bad grammar but no suggestions (e.g., repeated word), just leave off the suggestions
// list and trailing separator rather than adding a "No Guesses Found" item (matches AppKit)
if (misspelling) {
appendItem(NoGuessesItem);
appendItem(*separatorItem());
}
} else {
for (unsigned i = 0; i < size; i++) {
const String &guess = guesses[i];
if (!guess.isEmpty()) {
ContextMenuItem item(ActionType, ContextMenuItemTagSpellingGuess, guess);
appendItem(item);
}
}
appendItem(*separatorItem());
}
if (misspelling) {
appendItem(IgnoreSpellingItem);
appendItem(LearnSpellingItem);