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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 void NavigationManagerImpl::AddPendingItem( | 173 void NavigationManagerImpl::AddPendingItem( |
174 const GURL& url, | 174 const GURL& url, |
175 const web::Referrer& referrer, | 175 const web::Referrer& referrer, |
176 ui::PageTransition navigation_type, | 176 ui::PageTransition navigation_type, |
177 NavigationInitiationType initiation_type, | 177 NavigationInitiationType initiation_type, |
178 UserAgentOverrideOption user_agent_override_option) { | 178 UserAgentOverrideOption user_agent_override_option) { |
179 [session_controller_ addPendingItem:url | 179 [session_controller_ addPendingItem:url |
180 referrer:referrer | 180 referrer:referrer |
181 transition:navigation_type | 181 transition:navigation_type |
182 initiationType:initiation_type]; | 182 initiationType:initiation_type |
| 183 userAgentOverrideOption:user_agent_override_option]; |
183 | 184 |
184 // Set the user agent type for web URLs. | 185 // Set the user agent type for web URLs. |
185 NavigationItem* pending_item = GetPendingItem(); | 186 NavigationItem* pending_item = GetPendingItem(); |
186 if (!pending_item) | 187 if (!pending_item) |
187 return; | 188 return; |
188 | 189 |
189 // |user_agent_override_option| must be INHERIT if |pending_item|'s | 190 // |user_agent_override_option| must be INHERIT if |pending_item|'s |
190 // UserAgentType is NONE, as requesting a desktop or mobile user agent should | 191 // UserAgentType is NONE, as requesting a desktop or mobile user agent should |
191 // be disabled for app-specific URLs. | 192 // be disabled for app-specific URLs. |
192 DCHECK(pending_item->GetUserAgentType() != UserAgentType::NONE || | 193 DCHECK(pending_item->GetUserAgentType() != UserAgentType::NONE || |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 const ScopedNavigationItemImplList& items = [session_controller_ items]; | 459 const ScopedNavigationItemImplList& items = [session_controller_ items]; |
459 while (index >= 0) { | 460 while (index >= 0) { |
460 NavigationItem* item = items[index--].get(); | 461 NavigationItem* item = items[index--].get(); |
461 if (!client->IsAppSpecificURL(item->GetVirtualURL())) | 462 if (!client->IsAppSpecificURL(item->GetVirtualURL())) |
462 return item; | 463 return item; |
463 } | 464 } |
464 return nullptr; | 465 return nullptr; |
465 } | 466 } |
466 | 467 |
467 } // namespace web | 468 } // namespace web |
OLD | NEW |