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

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

Issue 2838003002: Fix missing back navigation item when pending item is displayed. (Closed)
Patch Set: To match desktop behavior: do not include pending item in session history Created 3 years, 8 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
« no previous file with comments | « no previous file | ios/web/navigation/crw_session_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/crw_session_controller.mm
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index 58d095a83c8377d39736ad1162c309865a44a407..275da0fa0448ff13c953bf7bbf7637161362d7e7 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -202,6 +202,14 @@ initiationType:(web::NavigationInitiationType)initiationType;
- (web::NavigationItemList)backwardItems {
web::NavigationItemList items;
+
+ // If the current navigation item is a transient item (e.g. SSL interstitial),
+ // the last committed item should also be considered part of the backward
+ // history.
+ if (self.transientItem) {
+ items.push_back(self.items[_lastCommittedItemIndex].get());
kkhorimoto 2017/04/26 10:50:37 Optional nit: items.push_back(self.lastCommittedIt
+ }
+
for (size_t index = _lastCommittedItemIndex; index > 0; --index) {
if (![self isRedirectTransitionForItemAtIndex:index])
items.push_back(self.items[index - 1].get());
« no previous file with comments | « no previous file | ios/web/navigation/crw_session_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698