Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: Source/web/FrameLoaderClientImpl.cpp

Issue 669013002: Remove BackForwardClient, cleanup starting a history navigation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/FrameLoaderClientImpl.cpp
diff --git a/Source/web/FrameLoaderClientImpl.cpp b/Source/web/FrameLoaderClientImpl.cpp
index f76882975b9aa0a6081406973539e328c9e50581..6c140aa0bd0ff00c4c91ee7bdf67d1302037428f 100644
--- a/Source/web/FrameLoaderClientImpl.cpp
+++ b/Source/web/FrameLoaderClientImpl.cpp
@@ -540,9 +540,9 @@ bool FrameLoaderClientImpl::navigateBackForward(int offset) const
return false;
ASSERT(offset);
- offset = std::min(offset, webview->client()->historyForwardListCount());
- offset = std::max(offset, -webview->client()->historyBackListCount());
- if (!offset)
+ if (offset > webview->client()->historyForwardListCount())
+ return false;
+ if (offset < -webview->client()->historyBackListCount())
return false;
webview->client()->navigateBackForwardSoon(offset);
return true;
@@ -866,4 +866,12 @@ void FrameLoaderClientImpl::dispatchDidChangeManifest()
m_webFrame->client()->didChangeManifest(m_webFrame);
}
+unsigned FrameLoaderClientImpl::backForwardLength()
+{
+ WebViewImpl* webview = m_webFrame->viewImpl();
+ if (!webview || !webview->client())
+ return 0;
+ return webview->client()->historyBackListCount() + 1 + webview->client()->historyForwardListCount();
+}
+
} // namespace blink
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698