| Index: ios/web/navigation/navigation_manager_impl.mm
|
| diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm
|
| index 8d3ccad5d1c72df4f5f424ea43a86b2aae556e7f..990b93022fff56af22fd1e13e7b1ada599d3f5f8 100644
|
| --- a/ios/web/navigation/navigation_manager_impl.mm
|
| +++ b/ios/web/navigation/navigation_manager_impl.mm
|
| @@ -275,18 +275,14 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) {
|
| return [session_controller_ itemAtIndex:index];
|
| }
|
|
|
| -int NavigationManagerImpl::GetCurrentItemIndex() const {
|
| - return [session_controller_ currentNavigationIndex];
|
| -}
|
| -
|
| int NavigationManagerImpl::GetPendingItemIndex() const {
|
| if (GetPendingItem()) {
|
| if ([session_controller_ pendingItemIndex] != -1) {
|
| return [session_controller_ pendingItemIndex];
|
| }
|
| - // TODO(crbug.com/665189): understand why current item index is
|
| + // TODO(crbug.com/665189): understand why last committed item index is
|
| // returned here.
|
| - return GetCurrentItemIndex();
|
| + return GetLastCommittedItemIndex();
|
| }
|
| return -1;
|
| }
|
| @@ -369,7 +365,7 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) {
|
|
|
| int NavigationManagerImpl::GetIndexForOffset(int offset) const {
|
| int result = [session_controller_ pendingItemIndex] == -1
|
| - ? GetCurrentItemIndex()
|
| + ? GetLastCommittedItemIndex()
|
| : static_cast<int>([session_controller_ pendingItemIndex]);
|
|
|
| if (offset < 0) {
|
| @@ -446,7 +442,7 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) {
|
|
|
| NavigationItem* NavigationManagerImpl::GetLastCommittedNonAppSpecificItem()
|
| const {
|
| - int index = GetCurrentItemIndex();
|
| + int index = GetLastCommittedItemIndex();
|
| if (index == -1)
|
| return nullptr;
|
| WebClient* client = GetWebClient();
|
|
|