diff options
Diffstat (limited to 'WebKit/chromium/src/BackForwardListClientImpl.cpp')
-rw-r--r-- | WebKit/chromium/src/BackForwardListClientImpl.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/WebKit/chromium/src/BackForwardListClientImpl.cpp b/WebKit/chromium/src/BackForwardListClientImpl.cpp index f5b04ab..af659bc 100644 --- a/WebKit/chromium/src/BackForwardListClientImpl.cpp +++ b/WebKit/chromium/src/BackForwardListClientImpl.cpp @@ -34,6 +34,7 @@ #include "HistoryItem.h" #include "WebViewClient.h" #include "WebViewImpl.h" +#include <wtf/text/StringConcatenate.h> using namespace WebCore; @@ -83,14 +84,15 @@ void BackForwardListClientImpl::goToItem(HistoryItem* item) m_pendingHistoryItem = 0; } -HistoryItem* BackForwardListClientImpl::currentItem() -{ - return m_currentItem.get(); -} - HistoryItem* BackForwardListClientImpl::itemAtIndex(int index) { - if (!m_webView->client() || index > forwardListCount() || -index > backListCount()) + if (!m_webView->client()) + return 0; + + if (!index) + return m_currentItem.get(); + + if (index > forwardListCount() || -index > backListCount()) return 0; // Since we don't keep the entire back/forward list, we have no way to @@ -102,11 +104,8 @@ HistoryItem* BackForwardListClientImpl::itemAtIndex(int index) // differently. It should perhaps just ask the FrameLoaderClient to // perform those navigations. - String url_string = String::format( - "%s://go/%d", backForwardNavigationScheme, index); - - m_pendingHistoryItem = - HistoryItem::create(url_string, String(), 0.0); + String urlString = makeString(backForwardNavigationScheme, "://go/", String::number(index)); + m_pendingHistoryItem = HistoryItem::create(urlString, String(), 0); return m_pendingHistoryItem.get(); } |