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

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

Issue 2705293014: Created web::UserAgentType. (Closed)
Patch Set: self review Created 3 years, 10 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/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)];
}

Powered by Google App Engine
This is Rietveld 408576698