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

Unified Diff: ios/web/navigation/navigation_manager_impl.mm

Issue 2600263002: [ios] Fixed GetIndexForOffset for pending transient items. (Closed)
Patch Set: Fixed tests Created 4 years 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 | « no previous file | ios/web/navigation/navigation_manager_impl_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/navigation_manager_impl.mm
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm
index e86102b314481a4d5bb6dfed6b60922e1377a89f..76c725a58af237405744da86159b7e5860c8fa17 100644
--- a/ios/web/navigation/navigation_manager_impl.mm
+++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -344,9 +344,10 @@ int NavigationManagerImpl::GetIndexForOffset(int offset) const {
: static_cast<int>([session_controller_ pendingEntryIndex]);
if (offset < 0) {
- if (GetTransientItem()) {
- // Going back from transient item is a matter of discarding it and there
- // is no need to move navigation index back.
+ if (GetTransientItem() && [session_controller_ pendingEntryIndex] == -1) {
+ // Going back from transient item that added to the end navigation stack
+ // is a matter of discarding it as there is no need to move navigation
+ // index back.
offset++;
}
« no previous file with comments | « no previous file | ios/web/navigation/navigation_manager_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698