Chromium Code Reviews| 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..bc56b897bcbbc4ba655d09986353d82b9084796d 100644 |
| --- a/ios/web/navigation/navigation_manager_impl.mm |
| +++ b/ios/web/navigation/navigation_manager_impl.mm |
| @@ -170,6 +170,20 @@ 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): Add a DCHECK that pending item should always exists |
|
Eugene But (OOO till 7-30)
2017/04/05 22:05:39
There is no need for DCHECK, because when crbug.co
|
| + // when the bug is fixed, because transient item is only supposed to be added |
| + // for pending non-app-specific loads. |
| + NavigationItem* item = GetPendingItem(); |
| + if (!item) |
| + item = GetLastCommittedNonAppSpecificItem(); |
| + DCHECK(!item || item->GetUserAgentType() != UserAgentType::NONE); |
| + if (item) |
|
Eugene But (OOO till 7-30)
2017/04/05 22:05:39
When can |item| be null?
|
| + GetTransientItem()->SetUserAgentType(item->GetUserAgentType()); |
| +} |
| + |
| void NavigationManagerImpl::AddPendingItem( |
| const GURL& url, |
| const web::Referrer& referrer, |