本文整理汇总了C++中PluginView::findString方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginView::findString方法的具体用法?C++ PluginView::findString怎么用?C++ PluginView::findString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginView
的用法示例。
在下文中一共展示了PluginView::findString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findString
void FindController::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
PluginView* pluginView = pluginViewForFrame(m_webPage->mainFrame());
bool found;
if (pluginView)
found = pluginView->findString(string, core(options), maxMatchCount);
else
found = m_webPage->corePage()->findString(string, core(options));
m_webPage->drawingArea()->dispatchAfterEnsuringUpdatedScrollPosition(WTF::bind(&FindController::updateFindUIAfterPageScroll, this, found, string, options, maxMatchCount));
}
示例2: findString
void FindController::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
PluginView* pluginView = pluginViewForFrame(m_webPage->mainFrame());
WebCore::FindOptions coreOptions = core(options);
// iOS will reveal the selection through a different mechanism, and
// we need to avoid sending the non-painted selection change to the UI process
// so that it does not clear the selection out from under us.
#if PLATFORM(IOS)
coreOptions = static_cast<FindOptions>(coreOptions | DoNotRevealSelection);
#endif
willFindString();
bool foundStringStartsAfterSelection = false;
if (!pluginView) {
if (Frame* selectedFrame = frameWithSelection(m_webPage->corePage())) {
FrameSelection& fs = selectedFrame->selection();
if (fs.selectionBounds().isEmpty()) {
m_findMatches.clear();
int indexForSelection;
m_webPage->corePage()->findStringMatchingRanges(string, core(options), maxMatchCount, m_findMatches, indexForSelection);
m_foundStringMatchIndex = indexForSelection;
foundStringStartsAfterSelection = true;
}
}
}
bool found;
if (pluginView)
found = pluginView->findString(string, coreOptions, maxMatchCount);
else
found = m_webPage->corePage()->findString(string, coreOptions);
if (found) {
didFindString();
if (!foundStringStartsAfterSelection) {
if (options & FindOptionsBackwards)
m_foundStringMatchIndex--;
else
m_foundStringMatchIndex++;
}
}
RefPtr<WebPage> protectedWebPage = m_webPage;
m_webPage->drawingArea()->dispatchAfterEnsuringUpdatedScrollPosition([protectedWebPage, found, string, options, maxMatchCount] () {
protectedWebPage->findController().updateFindUIAfterPageScroll(found, string, options, maxMatchCount);
});
}
示例3: hideFindUI
void FindController::hideFindUI()
{
m_findMatches.clear();
if (m_findPageOverlay)
m_webPage->uninstallPageOverlay(m_findPageOverlay, true);
PluginView* pluginView = pluginViewForFrame(m_webPage->mainFrame());
if (pluginView)
pluginView->findString(emptyString(), 0, 0);
else
m_webPage->corePage()->unmarkAllTextMatches();
hideFindIndicator();
}