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

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

Issue 2794723002: Create new pending item if UserAgentOverrideOption is not INHERIT. (Closed)
Patch Set: self review 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
« no previous file with comments | « ios/web/navigation/crw_session_controller.h ('k') | ios/web/navigation/crw_session_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 292d9fc3eb2275fe8fe977f737e694619c28b546..4434bd99627dd7ee995d7093af760716963c7e5a 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -282,9 +282,11 @@ - (void)setBrowserState:(web::BrowserState*)browserState {
}
- (void)addPendingItem:(const GURL&)url
- referrer:(const web::Referrer&)ref
- transition:(ui::PageTransition)trans
- initiationType:(web::NavigationInitiationType)initiationType {
+ referrer:(const web::Referrer&)ref
+ transition:(ui::PageTransition)trans
+ initiationType:(web::NavigationInitiationType)initiationType
+ userAgentOverrideOption:(web::NavigationManager::UserAgentOverrideOption)
+ userAgentOverrideOption {
// Server side redirects are handled by updating existing pending item instead
// of adding a new item.
DCHECK((trans & ui::PAGE_TRANSITION_SERVER_REDIRECT) == 0);
@@ -312,6 +314,10 @@ - (void)addPendingItem:(const GURL&)url
!hasSameURL ||
(isPendingTransitionFormSubmit && !isCurrentTransitionFormSubmit);
+ if (userAgentOverrideOption !=
+ web::NavigationManager::UserAgentOverrideOption::INHERIT)
kkhorimoto 2017/04/05 23:01:44 I think we should also check whether the override
liaoyuke 2017/04/06 22:24:55 Theoretically, override option should always be di
+ shouldCreatePendingItem = YES;
+
if (!shouldCreatePendingItem) {
// Send the notification anyway, to preserve old behavior. It's unknown
// whether anything currently relies on this, but since both this whole
« no previous file with comments | « ios/web/navigation/crw_session_controller.h ('k') | ios/web/navigation/crw_session_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698