| 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 da2ae03a14d715f438312e472af75142eecc141b..54f69e5f33a0a7cb8a25256292935d1a0832580d 100644
|
| --- a/ios/web/navigation/navigation_manager_impl.mm
|
| +++ b/ios/web/navigation/navigation_manager_impl.mm
|
| @@ -170,6 +170,19 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) {
|
| delegate_->GetWebState()->OpenURL(params);
|
| }
|
|
|
| +void NavigationManagerImpl::AddTransientItem(const GURL& url) {
|
| + [session_controller_ addTransientItemWithURL:url];
|
| +
|
| + // TODO(crbug.com/676129): Transient item is only supposed to be added for
|
| + // pending non-app-specific loads, but pending item can be null because of the
|
| + // bug. The workaround should be removed once the bug is fixed.
|
| + NavigationItem* item = GetPendingItem();
|
| + if (!item)
|
| + item = GetLastCommittedNonAppSpecificItem();
|
| + DCHECK(item->GetUserAgentType() != UserAgentType::NONE);
|
| + GetTransientItem()->SetUserAgentType(item->GetUserAgentType());
|
| +}
|
| +
|
| void NavigationManagerImpl::AddPendingItem(
|
| const GURL& url,
|
| const web::Referrer& referrer,
|
|
|