Chromium Code Reviews| 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 31a3377b3ade1cfd36a29384fade3e5df96e02c6..0f5b9dcde986b4b5fd71f19123af50fb06aa786f 100644 |
| --- a/ios/web/navigation/navigation_manager_impl.mm |
| +++ b/ios/web/navigation/navigation_manager_impl.mm |
| @@ -86,6 +86,7 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { |
| void NavigationManagerImpl::SetBrowserState(BrowserState* browser_state) { |
| browser_state_ = browser_state; |
| + [session_controller_ setBrowserState:browser_state]; |
|
Eugene But (OOO till 7-30)
2017/02/03 23:33:33
Does it change the logic? Should this be in a sepa
kkhorimoto
2017/02/04 02:45:30
Whoops, yes. I'll move it to a separate CL.
|
| } |
| void NavigationManagerImpl::SetSessionController( |
| @@ -222,7 +223,7 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { |
| } |
| void NavigationManagerImpl::DiscardNonCommittedItems() { |
| - [session_controller_ discardNonCommittedEntries]; |
| + [session_controller_ discardNonCommittedItems]; |
| } |
| void NavigationManagerImpl::LoadIfNecessary() { |
| @@ -258,9 +259,9 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { |
| } |
| int NavigationManagerImpl::GetPendingItemIndex() const { |
| - if ([session_controller_ hasPendingEntry]) { |
| - if ([session_controller_ pendingEntryIndex] != -1) { |
| - return [session_controller_ pendingEntryIndex]; |
| + if ([session_controller_ pendingEntry]) { |
| + if ([session_controller_ pendingItemIndex] != -1) { |
| + return [session_controller_ pendingItemIndex]; |
| } |
| // TODO(crbug.com/665189): understand why current item index is |
| // returned here. |
| @@ -284,7 +285,7 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { |
| if (idx >= entries.count) |
| return false; |
| - [session_controller_ removeEntryAtIndex:index]; |
| + [session_controller_ removeItemAtIndex:index]; |
| return true; |
| } |
| @@ -341,12 +342,12 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { |
| } |
| int NavigationManagerImpl::GetIndexForOffset(int offset) const { |
| - int result = [session_controller_ pendingEntryIndex] == -1 |
| + int result = [session_controller_ pendingItemIndex] == -1 |
| ? GetCurrentItemIndex() |
| - : static_cast<int>([session_controller_ pendingEntryIndex]); |
| + : static_cast<int>([session_controller_ pendingItemIndex]); |
| if (offset < 0) { |
| - if (GetTransientItem() && [session_controller_ pendingEntryIndex] == -1) { |
| + if (GetTransientItem() && [session_controller_ pendingItemIndex] == -1) { |
| // Going back from transient item that added to the end navigation stack |
| // is a matter of discarding it as there is no need to move navigation |
| // index back. |
| @@ -370,7 +371,7 @@ bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { |
| if (result > GetItemCount() /* overflow */) |
| result = INT_MIN; |
| } else if (offset > 0) { |
| - if (GetPendingItem() && [session_controller_ pendingEntryIndex] == -1) { |
| + if (GetPendingItem() && [session_controller_ pendingItemIndex] == -1) { |
| // Chrome for iOS does not allow forward navigation if there is another |
| // pending navigation in progress. Returning invalid index indicates that |
| // forward navigation will not be allowed (and |INT_MAX| works for that). |