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

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

Issue 2873063002: Use the current title for items created by same document navigations. (Closed)
Patch Set: Created 3 years, 7 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/web_state/ui/crw_web_controller_unittest.mm » ('j') | 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 162acc53fd29c37d8e4c80f52dd0bbf698e38b64..f445bd7d223fe0a6e880919fe929d722658f60c0 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -4873,8 +4873,14 @@ registerLoadRequestForURL:(const GURL&)requestURL
if (!_changingHistoryState) {
// If this wasn't a previously-expected load (e.g., certain back/forward
// navigations), register the load request.
- if (![self isLoadRequestPendingForURL:newURL])
+ if (![self isLoadRequestPendingForURL:newURL]) {
navigationContext = [self registerLoadRequestForURL:newURL];
+
+ // Use the current title for items created by same document navigations.
+ auto* pendingItem = self.navigationManagerImpl->GetPendingItem();
+ if (pendingItem)
+ pendingItem->SetTitle(_webStateImpl->GetTitle());
+ }
}
[self setDocumentURL:newURL];
« no previous file with comments | « no previous file | ios/web/web_state/ui/crw_web_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698