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

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: Address comments 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 const ScopedNavigationItemImplList& items = [session_controller_ items]; 472 const ScopedNavigationItemImplList& items = [session_controller_ items];
472 while (index >= 0) { 473 while (index >= 0) {
473 NavigationItem* item = items[index--].get(); 474 NavigationItem* item = items[index--].get();
474 if (!client->IsAppSpecificURL(item->GetVirtualURL())) 475 if (!client->IsAppSpecificURL(item->GetVirtualURL()))
475 return item; 476 return item;
476 } 477 }
477 return nullptr; 478 return nullptr;
478 } 479 }
479 480
480 } // namespace web 481 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698