本文整理汇总了C++中Page::backForward方法的典型用法代码示例。如果您正苦于以下问题:C++ Page::backForward方法的具体用法?C++ Page::backForward怎么用?C++ Page::backForward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::backForward方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: goToItem
// Main funnel for navigating to a previous location (back/forward, non-search snap-back)
// This includes recursion to handle loading into framesets properly
void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type)
{
ASSERT(!m_frame->tree()->parent());
// shouldGoToHistoryItem is a private delegate method. This is needed to fix:
// <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls
// Ultimately, history item navigations should go through the policy delegate. That's covered in:
// <rdar://problem/3979539> back/forward cache navigations should consult policy delegate
Page* page = m_frame->page();
if (!page)
return;
if (!m_frame->loader()->client()->shouldGoToHistoryItem(targetItem))
return;
if (m_defersLoading) {
m_deferredItem = targetItem;
m_deferredFrameLoadType = type;
return;
}
// Set the BF cursor before commit, which lets the user quickly click back/forward again.
// - plus, it only makes sense for the top level of the operation through the frametree,
// as opposed to happening for some/one of the page commits that might happen soon
RefPtr<HistoryItem> currentItem = page->backForward()->currentItem();
page->backForward()->setCurrentItem(targetItem);
m_frame->loader()->client()->updateGlobalHistoryItemForPage();
// First set the provisional item of any frames that are not actually navigating.
// This must be done before trying to navigate the desired frame, because some
// navigations can commit immediately (such as about:blank). We must be sure that
// all frames have provisional items set before the commit.
recursiveSetProvisionalItem(targetItem, currentItem.get(), type);
// Now that all other frames have provisional items, do the actual navigation.
recursiveGoToItem(targetItem, currentItem.get(), type);
}
示例2: pushState
void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
{
if (!m_currentItem)
return;
Page* page = m_frame->page();
ASSERT(page);
// Get a HistoryItem tree for the current frame tree.
RefPtr<HistoryItem> topItem = page->mainFrame()->loader()->history()->createItemTree(m_frame, false);
// Override data in the current item (created by createItemTree) to reflect
// the pushState() arguments.
m_currentItem->setTitle(title);
m_currentItem->setStateObject(stateObject);
m_currentItem->setURLString(urlString);
page->backForward()->addItem(topItem.release());
Settings* settings = m_frame->settings();
if (!settings || settings->privateBrowsingEnabled())
return;
addVisitedLink(page, KURL(ParsedURLString, urlString));
m_frame->loader()->client()->updateGlobalHistory();
}
示例3: pushState
void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
{
if (!m_currentItem)
return;
Page* page = m_frame.page();
ASSERT(page);
// Get a HistoryItem tree for the current frame tree.
Ref<HistoryItem> topItem = m_frame.mainFrame().loader().history().createItemTree(m_frame, false);
// Override data in the current item (created by createItemTree) to reflect
// the pushState() arguments.
m_currentItem->setTitle(title);
m_currentItem->setStateObject(stateObject);
m_currentItem->setURLString(urlString);
LOG(History, "HistoryController %p pushState: Adding top item %p, setting url of current item %p to %s", this, topItem.ptr(), m_currentItem.get(), urlString.ascii().data());
page->backForward().addItem(WTFMove(topItem));
if (m_frame.page()->usesEphemeralSession())
return;
addVisitedLink(*page, URL(ParsedURLString, urlString));
m_frame.loader().client().updateGlobalHistory();
}
示例4: goToItem
// Main funnel for navigating to a previous location (back/forward, non-search snap-back)
// This includes recursion to handle loading into framesets properly
void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type)
{
ASSERT(!m_frame->tree()->parent());
// shouldGoToHistoryItem is a private delegate method. This is needed to fix:
// <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls
// Ultimately, history item navigations should go through the policy delegate. That's covered in:
// <rdar://problem/3979539> back/forward cache navigations should consult policy delegate
Page* page = m_frame->page();
if (!page)
return;
if (!m_frame->loader()->client()->shouldGoToHistoryItem(targetItem))
return;
// Set the BF cursor before commit, which lets the user quickly click back/forward again.
// - plus, it only makes sense for the top level of the operation through the frametree,
// as opposed to happening for some/one of the page commits that might happen soon
HistoryItem* currentItem = page->backForward()->currentItem();
page->backForward()->setCurrentItem(targetItem);
Settings* settings = m_frame->settings();
page->setGlobalHistoryItem((!settings || settings->privateBrowsingEnabled()) ? 0 : targetItem);
recursiveGoToItem(targetItem, currentItem, type);
}
示例5: setPageAndTextZoomFactors
void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor)
{
if (m_pageZoomFactor == pageZoomFactor && m_textZoomFactor == textZoomFactor)
return;
Page* page = this->page();
if (!page)
return;
Document* document = this->document();
if (!document)
return;
m_editor.dismissCorrectionPanelAsIgnored();
#if ENABLE(SVG)
// Respect SVGs zoomAndPan="disabled" property in standalone SVG documents.
// FIXME: How to handle compound documents + zoomAndPan="disabled"? Needs SVG WG clarification.
if (document->isSVGDocument()) {
if (!static_cast<SVGDocument*>(document)->zoomAndPanEnabled())
return;
}
#endif
if (m_pageZoomFactor != pageZoomFactor) {
if (FrameView* view = this->view()) {
// Update the scroll position when doing a full page zoom, so the content stays in relatively the same position.
LayoutPoint scrollPosition = view->scrollPosition();
float percentDifference = (pageZoomFactor / m_pageZoomFactor);
view->setScrollPosition(IntPoint(scrollPosition.x() * percentDifference, scrollPosition.y() * percentDifference));
}
}
m_pageZoomFactor = pageZoomFactor;
m_textZoomFactor = textZoomFactor;
document->recalcStyle(Node::Force);
for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
child->setPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor);
if (FrameView* view = this->view()) {
if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
view->layout();
}
if (page->mainFrame() == this)
page->backForward()->markPagesForFullStyleRecalc();
}
示例6: addState
void HistoryController::addState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
{
Page* page = m_frame->page();
ASSERT(page);
// Get a HistoryItem tree for the current frame tree.
RefPtr<HistoryItem> item = HistoryItem::create();
initializeItem(item.get());
item->setTitle(title);
item->setStateObject(stateObject);
item->setURLString(urlString);
page->backForward()->addItem(item.release());
addVisitedLink(page, KURL(ParsedURLString, urlString));
m_frame->loader()->client()->updateGlobalHistory();
}
示例7: pushState
void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
{
if (!m_currentItem)
return;
Page* page = m_frame->page();
ASSERT(page);
// Get a HistoryItem tree for the current frame tree.
RefPtr<HistoryItem> topItem = page->mainFrame()->loader()->history()->createItemTree(m_frame, false);
// Override data in the current item (created by createItemTree) to reflect
// the pushState() arguments.
m_currentItem->setTitle(title);
m_currentItem->setStateObject(stateObject);
m_currentItem->setURLString(urlString);
page->backForward().addItem(topItem.release());
}
示例8: updateBackForwardListClippedAtTarget
void HistoryController::updateBackForwardListClippedAtTarget(bool doClip)
{
// In the case of saving state about a page with frames, we store a tree of items that mirrors the frame tree.
// The item that was the target of the user's navigation is designated as the "targetItem".
// When this function is called with doClip=true we're able to create the whole tree except for the target's children,
// which will be loaded in the future. That part of the tree will be filled out as the child loads are committed.
Page* page = m_frame.page();
if (!page)
return;
if (m_frame.loader().documentLoader()->urlForHistory().isEmpty())
return;
FrameLoader& frameLoader = m_frame.mainFrame().loader();
RefPtr<HistoryItem> topItem = frameLoader.history().createItemTree(m_frame, doClip);
LOG(BackForward, "WebCoreBackForward - Adding backforward item %p for frame %s", topItem.get(), m_frame.loader().documentLoader()->url().string().ascii().data());
page->backForward().addItem(topItem.release());
}
示例9: finishedParsing
void WMLDocument::finishedParsing()
{
if (ScriptableDocumentParser* parser = this->scriptableDocumentParser()) {
if (!parser->wellFormed()) {
Document::finishedParsing();
return;
}
}
bool hasAccess = initialize(true);
Document::finishedParsing();
if (!hasAccess) {
m_activeCard = 0;
WMLPageState* wmlPageState = wmlPageStateForDocument(this);
if (!wmlPageState)
return;
Page* page = wmlPageState->page();
if (!page)
return;
HistoryItem* item = page->backForward()->backItem();
if (!item)
return;
page->goToItem(item, FrameLoadTypeBackWMLDeckNotAccessible);
return;
}
/// M: ALPS00439551 set a flag to prevent infinite loop in WMLDocument @{
if (m_policyDownloadError) {
m_policyDownloadError = false;
return;
}
/// @}
/// M: ALPS00439551 use a timer to trigger handleIntrinsicEventIfNeeded()
m_intrinsicEventTimer.startOneShot(0.0f);
}