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

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

Issue 2779263002: Set user agent type of transient item the same as pending item. (Closed)
Patch Set: Remove code duplication Created 3 years, 9 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/navigation_manager_impl.mm
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm
index b1cb00ee08f28b94e62bc900685036b21e46650e..2e6b6ab336926d0c0bf02e527d4a2acb5bdae9c6 100644
--- a/ios/web/navigation/navigation_manager_impl.mm
+++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -170,6 +170,16 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) {
delegate_->GetWebState()->OpenURL(params);
}
+void NavigationManagerImpl::AddTransientItem(const GURL& url) {
+ [session_controller_ addTransientItemWithURL:url];
+ DCHECK(GetTransientItem());
+
+ // Transient item can only be added for pending non-app-specific loads.
+ DCHECK(GetPendingItem());
Eugene But (OOO till 7-30) 2017/03/31 18:33:00 nit: No need to DCHECK, the next line will crash a
liaoyuke 2017/04/04 17:25:01 Done.
+ DCHECK_NE(UserAgentType::NONE, GetPendingItem()->GetUserAgentType());
+ GetTransientItem()->SetUserAgentType(GetPendingItem()->GetUserAgentType());
+}
+
void NavigationManagerImpl::AddPendingItem(
const GURL& url,
const web::Referrer& referrer,
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.h ('k') | ios/web/navigation/navigation_manager_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698