当前位置: 首页>>代码示例>>C++>>正文


C++ WebHistory::itemForURLString方法代码示例

本文整理汇总了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());
        }
    }
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:20,代码来源:WebFrameLoaderClient.cpp

示例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());
                }
            }
        }
    }
}
开发者ID:,项目名称:,代码行数:41,代码来源:

示例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());
        }
    }
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:22,代码来源:WebFrameLoaderClient.cpp

示例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());
            }
        }
    }
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:36,代码来源:WebFrameLoaderClient.cpp


注:本文中的WebHistory::itemForURLString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。