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

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: Created 6 years, 2 months 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
Index: Source/web/FrameLoaderClientImpl.cpp
diff --git a/Source/web/FrameLoaderClientImpl.cpp b/Source/web/FrameLoaderClientImpl.cpp
index 107504056be14563f79a833c878ac0f713516dbe..d62b941c168b23c1e93588f06d929e03f021aa15 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());
Nate Chapin 2014/10/22 19:57:18 This min/max bounding is unnecessary. For backspac
- if (!offset)
+ if (offset > webview->client()->historyForwardListCount())
+ return false;
+ if (offset < -webview->client()->historyBackListCount())
return false;
webview->client()->navigateBackForwardSoon(offset);
return true;
@@ -859,4 +859,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

Powered by Google App Engine
This is Rietveld 408576698