diff options
author | Ben Murdoch <benm@google.com> | 2011-06-02 12:07:03 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-10 10:47:21 +0100 |
commit | 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch) | |
tree | e4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebCore/loader/HistoryController.cpp | |
parent | 87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff) | |
download | external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2 |
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebCore/loader/HistoryController.cpp')
-rw-r--r-- | Source/WebCore/loader/HistoryController.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp index b8bece9..f9d85bc 100644 --- a/Source/WebCore/loader/HistoryController.cpp +++ b/Source/WebCore/loader/HistoryController.cpp @@ -79,7 +79,7 @@ void HistoryController::saveScrollPositionAndViewStateToItem(HistoryItem* item) if (!item || !m_frame->view()) return; - item->setScrollPoint(m_frame->view()->scrollPosition()); + item->setScrollPoint(m_frame->view()->cachedScrollPosition()); item->setPageScaleFactor(m_frame->pageScaleFactor()); // FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client. @@ -265,7 +265,7 @@ void HistoryController::updateForBackForwardNavigation() { #if !LOG_DISABLED if (m_frame->loader()->documentLoader()) - LOG(History, "WebCoreHistory: Updating History for back/forward navigation in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); + LOG(History, "WebCoreHistory: Updating History for back/forward navigation in frame %s", m_frame->loader()->documentLoader()->title().string().utf8().data()); #endif // Must grab the current scroll position before disturbing it @@ -281,7 +281,7 @@ void HistoryController::updateForReload() { #if !LOG_DISABLED if (m_frame->loader()->documentLoader()) - LOG(History, "WebCoreHistory: Updating History for reload in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); + LOG(History, "WebCoreHistory: Updating History for reload in frame %s", m_frame->loader()->documentLoader()->title().string().utf8().data()); #endif if (m_currentItem) { @@ -343,7 +343,7 @@ void HistoryController::updateForRedirectWithLockedBackForwardList() { #if !LOG_DISABLED if (m_frame->loader()->documentLoader()) - LOG(History, "WebCoreHistory: Updating History for redirect load in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); + LOG(History, "WebCoreHistory: Updating History for redirect load in frame %s", m_frame->loader()->documentLoader()->title().string().utf8().data()); #endif Settings* settings = m_frame->settings(); @@ -385,7 +385,7 @@ void HistoryController::updateForClientRedirect() { #if !LOG_DISABLED if (m_frame->loader()->documentLoader()) - LOG(History, "WebCoreHistory: Updating History for client redirect in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); + LOG(History, "WebCoreHistory: Updating History for client redirect in frame %s", m_frame->loader()->documentLoader()->title().string().utf8().data()); #endif // Clear out form data so we don't try to restore it into the incoming page. Must happen after @@ -410,7 +410,7 @@ void HistoryController::updateForCommit() FrameLoader* frameLoader = m_frame->loader(); #if !LOG_DISABLED if (frameLoader->documentLoader()) - LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frameLoader->documentLoader()->title().utf8().data()); + LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frameLoader->documentLoader()->title().string().utf8().data()); #endif FrameLoadType type = frameLoader->loadType(); if (isBackForwardLoadType(type) @@ -526,10 +526,11 @@ void HistoryController::setCurrentItem(HistoryItem* item) m_currentItem = item; } -void HistoryController::setCurrentItemTitle(const String& title) +void HistoryController::setCurrentItemTitle(const StringWithDirection& title) { if (m_currentItem) - m_currentItem->setTitle(title); + // FIXME: make use of title.direction() as well. + m_currentItem->setTitle(title.string()); } bool HistoryController::currentItemShouldBeReplaced() const @@ -576,12 +577,13 @@ void HistoryController::initializeItem(HistoryItem* item) Frame* parentFrame = m_frame->tree()->parent(); String parent = parentFrame ? parentFrame->tree()->uniqueName() : ""; - String title = documentLoader->title(); + StringWithDirection title = documentLoader->title(); item->setURL(url); item->setTarget(m_frame->tree()->uniqueName()); item->setParent(parent); - item->setTitle(title); + // FIXME: should store title directionality in history as well. + item->setTitle(title.string()); item->setOriginalURLString(originalURL.string()); if (!unreachableURL.isEmpty() || documentLoader->response().httpStatusCode() >= 400) @@ -797,6 +799,10 @@ void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject, m_currentItem->setURLString(urlString); page->backForward()->addItem(topItem.release()); + + addVisitedLink(page, KURL(ParsedURLString, urlString)); + m_frame->loader()->client()->updateGlobalHistory(); + } void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString) @@ -808,6 +814,10 @@ void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObje m_currentItem->setURLString(urlString); m_currentItem->setTitle(title); m_currentItem->setStateObject(stateObject); + + ASSERT(m_frame->page()); + addVisitedLink(m_frame->page(), KURL(ParsedURLString, urlString)); + m_frame->loader()->client()->updateGlobalHistory(); } } // namespace WebCore |