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

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

Issue 2838003002: Fix missing back navigation item when pending item is displayed. (Closed)
Patch Set: 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
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..06491e1c7f1f56a2e1ef89fdd7befb7a88b68e2e 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -202,6 +202,16 @@ initiationType:(web::NavigationInitiationType)initiationType;
- (web::NavigationItemList)backwardItems {
web::NavigationItemList items;
+
+ // Under normal circumstances, |visibleItem| is |lastCommittedItem| so
+ // backward history consists of all entries that precede |lastCommittedItem|.
+ // However, if the visible navigation item is a transient or uncommitted
Eugene But (OOO till 7-30) 2017/04/25 05:49:01 Do we need to include pending item into backwardIt
danyao 2017/04/25 16:31:20 I don't think pendingItem should be included in th
Eugene But (OOO till 7-30) 2017/04/25 20:44:40 Sorry, I incorrectly phrased my question, I meant
Eugene But (OOO till 7-30) 2017/04/25 21:23:10 I think this code would be correct, unless I'm mis
+ // pending item, an example being safe browsing warning interstitials, all
Eugene But (OOO till 7-30) 2017/04/25 05:49:01 s/safe browsing warning/SSL Unlike other platform
danyao 2017/04/25 16:31:20 Done.
+ // committed items should be considered part of the backward history.
+ if (self.visibleItem != self.lastCommittedItem) {
+ items.push_back(self.items[_lastCommittedItemIndex].get());
Eugene But (OOO till 7-30) 2017/04/25 05:49:01 We probably should not include redirect item. Woul
danyao 2017/04/25 16:31:20 The current behavior (starting line 215) is to inc
Eugene But (OOO till 7-30) 2017/04/25 20:44:40 You are right. Please ignore me.
+ }
+
for (size_t index = _lastCommittedItemIndex; index > 0; --index) {
if (![self isRedirectTransitionForItemAtIndex:index])
items.push_back(self.items[index - 1].get());

Powered by Google App Engine
This is Rietveld 408576698