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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2728723002: Cleaned up code duplication in -[CRWWebController goToItemAtIndex:]. (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index d6deb8224888d1bf490aa57fa80865af817ba95d..5d3d172b208b6c4a1e921e4a8ed74959b443cbcc 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -2133,24 +2133,18 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
if (![userDefaults boolForKey:@"PendingIndexNavigationDisabled"]) {
[self clearTransientContentView];
+ [self updateDesktopUserAgentForEntry:toEntry fromEntry:fromEntry];
BOOL sameDocumentNavigation = [sessionController
isSameDocumentNavigationBetweenItem:fromEntry.navigationItem
andItem:toEntry.navigationItem];
if (sameDocumentNavigation) {
- [self.sessionController goToItemAtIndex:index];
- // TODO(crbug.com/684098): move this call out this block to avoid code
- // duplication.
- [self webWillFinishHistoryNavigationFromEntry:fromEntry];
+ [sessionController goToItemAtIndex:index];
[self updateHTML5HistoryState];
} else {
[sessionController discardNonCommittedItems];
[sessionController setPendingItemIndex:index];
- // TODO(crbug.com/684098): move this call out this block to avoid code
- // duplication.
- [self webWillFinishHistoryNavigationFromEntry:fromEntry];
-
web::NavigationItemImpl* pendingItem =
sessionController.pendingEntry.navigationItemImpl;
pendingItem->SetTransitionType(ui::PageTransitionFromInt(
@@ -2159,7 +2153,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
[self loadCurrentURL];
}
} else {
- [self.sessionController goToItemAtIndex:index];
+ [sessionController goToItemAtIndex:index];
if (fromEntry)
[self finishHistoryNavigationFromEntry:fromEntry];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698