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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 } | 163 } |
164 | 164 |
165 void NavigationManagerImpl::LoadURL(const GURL& url, | 165 void NavigationManagerImpl::LoadURL(const GURL& url, |
166 const web::Referrer& referrer, | 166 const web::Referrer& referrer, |
167 ui::PageTransition type) { | 167 ui::PageTransition type) { |
168 WebState::OpenURLParams params(url, referrer, | 168 WebState::OpenURLParams params(url, referrer, |
169 WindowOpenDisposition::CURRENT_TAB, type, NO); | 169 WindowOpenDisposition::CURRENT_TAB, type, NO); |
170 delegate_->GetWebState()->OpenURL(params); | 170 delegate_->GetWebState()->OpenURL(params); |
171 } | 171 } |
172 | 172 |
173 void NavigationManagerImpl::AddTransientItem(const GURL& url) { | |
174 [session_controller_ addTransientItemWithURL:url]; | |
175 DCHECK(GetTransientItem()); | |
176 | |
177 // Transient item can only be added for pending non-app-specific loads. | |
178 DCHECK(GetPendingItem()); | |
179 DCHECK(GetPendingItem()->GetUserAgentType() != UserAgentType::NONE); | |
Eugene But (OOO till 7-30)
2017/03/30 23:01:49
DCHECK_NE
liaoyuke
2017/03/31 15:50:12
Done.
| |
180 GetTransientItem()->SetUserAgentType(GetPendingItem()->GetUserAgentType()); | |
181 } | |
182 | |
173 void NavigationManagerImpl::AddPendingItem( | 183 void NavigationManagerImpl::AddPendingItem( |
174 const GURL& url, | 184 const GURL& url, |
175 const web::Referrer& referrer, | 185 const web::Referrer& referrer, |
176 ui::PageTransition navigation_type, | 186 ui::PageTransition navigation_type, |
177 NavigationInitiationType initiation_type) { | 187 NavigationInitiationType initiation_type) { |
178 [session_controller_ addPendingItem:url | 188 [session_controller_ addPendingItem:url |
179 referrer:referrer | 189 referrer:referrer |
180 transition:navigation_type | 190 transition:navigation_type |
181 initiationType:initiation_type]; | 191 initiationType:initiation_type]; |
182 | 192 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 const ScopedNavigationItemImplList& items = [session_controller_ items]; | 483 const ScopedNavigationItemImplList& items = [session_controller_ items]; |
474 while (index >= 0) { | 484 while (index >= 0) { |
475 NavigationItem* item = items[index--].get(); | 485 NavigationItem* item = items[index--].get(); |
476 if (!client->IsAppSpecificURL(item->GetVirtualURL())) | 486 if (!client->IsAppSpecificURL(item->GetVirtualURL())) |
477 return item; | 487 return item; |
478 } | 488 } |
479 return nullptr; | 489 return nullptr; |
480 } | 490 } |
481 | 491 |
482 } // namespace web | 492 } // namespace web |
OLD | NEW |