本文整理汇总了C++中WebHistory::itemForURLString方法的典型用法代码示例。如果您正苦于以下问题:C++ WebHistory::itemForURLString方法的具体用法?C++ WebHistory::itemForURLString怎么用?C++ WebHistory::itemForURLString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebHistory
的用法示例。
在下文中一共展示了WebHistory::itemForURLString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateGlobalHistoryRedirectLinks
void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
WebHistory* history = WebHistory::sharedHistory();
if (!history)
return;
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
ASSERT(loader->unreachableURL().isEmpty());
if (!loader->clientRedirectSourceForHistory().isNull()) {
if (WebHistoryItem *webHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) {
webHistoryItem->getPrivateItem()->m_historyItem.get()->addRedirectURL(loader->clientRedirectDestinationForHistory());
}
}
if (!loader->serverRedirectSourceForHistory().isNull()) {
if (WebHistoryItem *webHistoryItem = history->itemForURLString(loader->serverRedirectSourceForHistory())) {
webHistoryItem->getPrivateItem()->m_historyItem.get()->addRedirectURL(loader->serverRedirectDestinationForHistory());
}
}
}
示例2: updateGlobalHistoryRedirectLinks
void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
WebView* webView = m_webFrame->webView();
COMPtr<IWebHistoryDelegate> historyDelegate;
webView->historyDelegate(&historyDelegate);
WebHistory* history = WebHistory::sharedHistory();
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
ASSERT(loader->unreachableURL().isEmpty());
if (!loader->clientRedirectSourceForHistory().isNull()) {
if (historyDelegate) {
BString sourceURL(loader->clientRedirectSourceForHistory());
BString destURL(loader->clientRedirectDestinationForHistory());
historyDelegate->didPerformClientRedirectFromURL(webView, sourceURL, destURL, m_webFrame);
} else {
if (history) {
if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) {
COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem);
webHistoryItem->historyItem()->addRedirectURL(loader->clientRedirectDestinationForHistory());
}
}
}
}
if (!loader->serverRedirectSourceForHistory().isNull()) {
if (historyDelegate) {
BString sourceURL(loader->serverRedirectSourceForHistory());
BString destURL(loader->serverRedirectDestinationForHistory());
historyDelegate->didPerformServerRedirectFromURL(webView, sourceURL, destURL, m_webFrame);
} else {
if (history) {
if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->serverRedirectSourceForHistory())) {
COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem);
webHistoryItem->historyItem()->addRedirectURL(loader->serverRedirectDestinationForHistory());
}
}
}
}
}
示例3: updateGlobalHistoryRedirectLinks
void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
WebHistory* history = WebHistory::sharedHistory();
if (!history)
return;
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
if (!loader->clientRedirectSourceForHistory().isNull()) {
if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) {
COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem);
webHistoryItem->historyItem()->addRedirectURL(loader->clientRedirectDestinationForHistory());
}
}
if (!loader->serverRedirectSourceForHistory().isNull()) {
if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->serverRedirectSourceForHistory())) {
COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem);
webHistoryItem->historyItem()->addRedirectURL(loader->serverRedirectDestinationForHistory());
}
}
}
示例4: updateGlobalHistoryRedirectLinks
void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
{
WebView* webView = m_webFrame->webView();
SharedPtr<WebHistoryDelegate> historyDelegate = webView->historyDelegate();
WebHistory* history = WebHistory::sharedHistory();
DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
ASSERT(loader->unreachableURL().isEmpty());
if (!loader->clientRedirectSourceForHistory().isNull()) {
if (historyDelegate) {
String sourceURL(loader->clientRedirectSourceForHistory());
String destinationURL(loader->clientRedirectDestinationForHistory());
historyDelegate->didPerformClientRedirectFromURL(webView, sourceURL.utf8().data(), destinationURL.utf8().data(), m_webFrame);
} else {
if (history) {
if (WebHistoryItem* webHistoryItem = history->itemForURLString(strdup(loader->clientRedirectSourceForHistory().utf8().data())))
webHistoryItem->getPrivateItem()->m_historyItem.get()->addRedirectURL(loader->clientRedirectDestinationForHistory());
}
}
}
if (!loader->serverRedirectSourceForHistory().isNull()) {
if (historyDelegate) {
String sourceURL(loader->serverRedirectSourceForHistory());
String destinationURL(loader->serverRedirectDestinationForHistory());
historyDelegate->didPerformServerRedirectFromURL(webView, sourceURL.utf8().data(), destinationURL.utf8().data(), m_webFrame);
} else {
if (history) {
if (WebHistoryItem *webHistoryItem = history->itemForURLString(strdup(loader->serverRedirectSourceForHistory().utf8().data())))
webHistoryItem->getPrivateItem()->m_historyItem.get()->addRedirectURL(loader->serverRedirectDestinationForHistory());
}
}
}
}