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

Side by Side Diff: ios/web/navigation/navigation_manager_impl.mm

Issue 2794723002: Create new pending item if UserAgentOverrideOption is not INHERIT. (Closed)
Patch Set: Rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/navigation/navigation_manager_impl.h" 5 #import "ios/web/navigation/navigation_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 void NavigationManagerImpl::AddPendingItem( 186 void NavigationManagerImpl::AddPendingItem(
187 const GURL& url, 187 const GURL& url,
188 const web::Referrer& referrer, 188 const web::Referrer& referrer,
189 ui::PageTransition navigation_type, 189 ui::PageTransition navigation_type,
190 NavigationInitiationType initiation_type, 190 NavigationInitiationType initiation_type,
191 UserAgentOverrideOption user_agent_override_option) { 191 UserAgentOverrideOption user_agent_override_option) {
192 [session_controller_ addPendingItem:url 192 [session_controller_ addPendingItem:url
193 referrer:referrer 193 referrer:referrer
194 transition:navigation_type 194 transition:navigation_type
195 initiationType:initiation_type]; 195 initiationType:initiation_type
196 userAgentOverrideOption:user_agent_override_option];
196 197
197 // Set the user agent type for web URLs. 198 // Set the user agent type for web URLs.
198 NavigationItem* pending_item = GetPendingItem(); 199 NavigationItem* pending_item = GetPendingItem();
199 if (!pending_item) 200 if (!pending_item)
200 return; 201 return;
201 202
202 // |user_agent_override_option| must be INHERIT if |pending_item|'s 203 // |user_agent_override_option| must be INHERIT if |pending_item|'s
203 // UserAgentType is NONE, as requesting a desktop or mobile user agent should 204 // UserAgentType is NONE, as requesting a desktop or mobile user agent should
204 // be disabled for app-specific URLs. 205 // be disabled for app-specific URLs.
205 DCHECK(pending_item->GetUserAgentType() != UserAgentType::NONE || 206 DCHECK(pending_item->GetUserAgentType() != UserAgentType::NONE ||
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 const ScopedNavigationItemImplList& items = [session_controller_ items]; 464 const ScopedNavigationItemImplList& items = [session_controller_ items];
464 while (index >= 0) { 465 while (index >= 0) {
465 NavigationItem* item = items[index--].get(); 466 NavigationItem* item = items[index--].get();
466 if (!client->IsAppSpecificURL(item->GetVirtualURL())) 467 if (!client->IsAppSpecificURL(item->GetVirtualURL()))
467 return item; 468 return item;
468 } 469 }
469 return nullptr; 470 return nullptr;
470 } 471 }
471 472
472 } // namespace web 473 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/crw_session_controller_unittest.mm ('k') | ios/web/navigation/navigation_manager_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698