OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |