Chromium Code Reviews| 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 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #import "ios/web/navigation/crw_session_controller+private_constructors.h" | 12 #import "ios/web/navigation/crw_session_controller+private_constructors.h" |
| 13 #import "ios/web/navigation/crw_session_controller.h" | 13 #import "ios/web/navigation/crw_session_controller.h" |
| 14 #import "ios/web/navigation/navigation_item_impl.h" | 14 #import "ios/web/navigation/navigation_item_impl.h" |
| 15 #import "ios/web/navigation/navigation_item_impl_list.h" | 15 #import "ios/web/navigation/navigation_item_impl_list.h" |
| 16 #import "ios/web/navigation/navigation_manager_delegate.h" | 16 #import "ios/web/navigation/navigation_manager_delegate.h" |
| 17 #include "ios/web/navigation/navigation_manager_facade_delegate.h" | 17 #include "ios/web/navigation/navigation_manager_facade_delegate.h" |
| 18 #include "ios/web/public/load_committed_details.h" | 18 #include "ios/web/public/load_committed_details.h" |
| 19 #import "ios/web/public/navigation_item.h" | 19 #import "ios/web/public/navigation_item.h" |
| 20 #include "ios/web/public/reload_type.h" | |
| 20 #import "ios/web/public/web_client.h" | 21 #import "ios/web/public/web_client.h" |
| 21 #import "ios/web/public/web_state/web_state.h" | 22 #import "ios/web/public/web_state/web_state.h" |
| 22 #include "ui/base/page_transition_types.h" | 23 #include "ui/base/page_transition_types.h" |
| 23 | 24 |
| 24 #if !defined(__has_feature) || !__has_feature(objc_arc) | 25 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 25 #error "This file requires ARC support." | 26 #error "This file requires ARC support." |
| 26 #endif | 27 #endif |
| 27 | 28 |
| 28 namespace { | 29 namespace { |
| 29 | 30 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 } | 331 } |
| 331 | 332 |
| 332 void NavigationManagerImpl::GoForward() { | 333 void NavigationManagerImpl::GoForward() { |
| 333 delegate_->GoToIndex(GetIndexForOffset(1)); | 334 delegate_->GoToIndex(GetIndexForOffset(1)); |
| 334 } | 335 } |
| 335 | 336 |
| 336 void NavigationManagerImpl::GoToIndex(int index) { | 337 void NavigationManagerImpl::GoToIndex(int index) { |
| 337 delegate_->GoToIndex(index); | 338 delegate_->GoToIndex(index); |
| 338 } | 339 } |
| 339 | 340 |
| 340 void NavigationManagerImpl::Reload(bool check_for_reposts) { | 341 void NavigationManagerImpl::Reload(ReloadType reload_type, |
| 342 bool check_for_reposts) { | |
| 341 // Navigation manager may be empty if the only pending item failed to load | 343 // Navigation manager may be empty if the only pending item failed to load |
| 342 // with SSL error and the user has decided not to proceed. | 344 // with SSL error and the user has decided not to proceed. |
| 343 NavigationItem* item = GetVisibleItem(); | 345 NavigationItem* item = GetVisibleItem(); |
| 344 GURL url = item ? item->GetURL() : GURL(url::kAboutBlankURL); | 346 GURL url = item ? item->GetURL() : GURL(url::kAboutBlankURL); |
|
kkhorimoto
2017/03/10 21:26:45
Do you want to just update the logic here in this
liaoyuke
2017/03/10 21:42:34
The |Reload| function in navigation manager is not
kkhorimoto
2017/03/10 22:24:59
Okay that's fine. Can you add the details of how
| |
| 345 web::Referrer referrer = item ? item->GetReferrer() : web::Referrer(); | 347 web::Referrer referrer = item ? item->GetReferrer() : web::Referrer(); |
| 346 | 348 |
| 347 WebState::OpenURLParams params(url, referrer, | 349 WebState::OpenURLParams params(url, referrer, |
| 348 WindowOpenDisposition::CURRENT_TAB, | 350 WindowOpenDisposition::CURRENT_TAB, |
| 349 ui::PAGE_TRANSITION_RELOAD, NO); | 351 ui::PAGE_TRANSITION_RELOAD, NO); |
| 350 delegate_->GetWebState()->OpenURL(params); | 352 delegate_->GetWebState()->OpenURL(params); |
| 351 } | 353 } |
| 352 | 354 |
| 353 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> | 355 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> |
| 354 NavigationManagerImpl::GetTransientURLRewriters() { | 356 NavigationManagerImpl::GetTransientURLRewriters() { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 const ScopedNavigationItemImplList& items = [session_controller_ items]; | 447 const ScopedNavigationItemImplList& items = [session_controller_ items]; |
| 446 while (index >= 0) { | 448 while (index >= 0) { |
| 447 NavigationItem* item = items[index--].get(); | 449 NavigationItem* item = items[index--].get(); |
| 448 if (!client->IsAppSpecificURL(item->GetVirtualURL())) | 450 if (!client->IsAppSpecificURL(item->GetVirtualURL())) |
| 449 return item; | 451 return item; |
| 450 } | 452 } |
| 451 return nullptr; | 453 return nullptr; |
| 452 } | 454 } |
| 453 | 455 |
| 454 } // namespace web | 456 } // namespace web |
| OLD | NEW |