Index: ios/web/navigation/crw_session_controller.mm |
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm |
index 7f7eec763044f42cc71f4adbadc558bfcb7f17de..56259b7fca54476d832a35c9549e98fa7ecd57d0 100644 |
--- a/ios/web/navigation/crw_session_controller.mm |
+++ b/ios/web/navigation/crw_session_controller.mm |
@@ -27,6 +27,7 @@ |
#include "ios/web/public/browser_url_rewriter.h" |
#include "ios/web/public/referrer.h" |
#include "ios/web/public/ssl_status.h" |
+#import "ios/web/public/web_client.h" |
#if !defined(__has_feature) || !__has_feature(objc_arc) |
#error "This file requires ARC support." |
@@ -507,8 +508,7 @@ - (void)pushNewItemWithURL:(const GURL&)URL |
initiationType:web::NavigationInitiationType::USER_INITIATED]); |
web::NavigationItemImpl* pushedItem = [pushedEntry navigationItemImpl]; |
- pushedItem->SetIsOverridingUserAgent( |
- lastCommittedItem->IsOverridingUserAgent()); |
+ pushedItem->SetUserAgentType(lastCommittedItem->GetUserAgentType()); |
pushedItem->SetSerializedStateObject(stateObject); |
pushedItem->SetIsCreatedFromPushState(true); |
pushedItem->GetSSL() = lastCommittedItem->GetSSL(); |
@@ -714,6 +714,8 @@ - (CRWSessionEntry*)sessionEntryWithURL:(const GURL&)url |
item->SetReferrer(referrer); |
item->SetTransitionType(transition); |
item->SetNavigationInitiationType(initiationType); |
+ if (web::GetWebClient()->IsAppSpecificURL(loaded_url)) |
+ item->SetUserAgentType(web::UserAgentType::NONE); |
return [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]; |
} |