| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/crw_session_controller.h" | 5 #import "ios/web/navigation/crw_session_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 NSInteger forwardItemStartIndex = _lastCommittedItemIndex + 1; | 366 NSInteger forwardItemStartIndex = _lastCommittedItemIndex + 1; |
| 367 DCHECK(forwardItemStartIndex >= 0); | 367 DCHECK(forwardItemStartIndex >= 0); |
| 368 | 368 |
| 369 size_t itemCount = self.items.size(); | 369 size_t itemCount = self.items.size(); |
| 370 if (forwardItemStartIndex >= static_cast<NSInteger>(itemCount)) | 370 if (forwardItemStartIndex >= static_cast<NSInteger>(itemCount)) |
| 371 return; | 371 return; |
| 372 | 372 |
| 373 if (_previousItemIndex >= forwardItemStartIndex) | 373 if (_previousItemIndex >= forwardItemStartIndex) |
| 374 _previousItemIndex = -1; | 374 _previousItemIndex = -1; |
| 375 | 375 |
| 376 // Remove the NavigationItems and notify the NavigationManater | 376 // Remove the NavigationItems and notify the NavigationManager. |
| 377 _items.erase(_items.begin() + forwardItemStartIndex, _items.end()); | 377 _items.erase(_items.begin() + forwardItemStartIndex, _items.end()); |
| 378 if (_navigationManager) { | 378 if (_navigationManager) { |
| 379 _navigationManager->OnNavigationItemsPruned(itemCount - | 379 _navigationManager->OnNavigationItemsPruned(itemCount - |
| 380 forwardItemStartIndex); | 380 forwardItemStartIndex); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 | 383 |
| 384 - (void)commitPendingItem { | 384 - (void)commitPendingItem { |
| 385 if (self.pendingItem) { | 385 if (self.pendingItem) { |
| 386 // Once an item is committed it's not renderer-initiated any more. (Matches | 386 // Once an item is committed it's not renderer-initiated any more. (Matches |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 return item; | 628 return item; |
| 629 } | 629 } |
| 630 | 630 |
| 631 - (BOOL)isRedirectTransitionForItemAtIndex:(size_t)index { | 631 - (BOOL)isRedirectTransitionForItemAtIndex:(size_t)index { |
| 632 DCHECK_LT(index, self.items.size()); | 632 DCHECK_LT(index, self.items.size()); |
| 633 ui::PageTransition transition = self.items[index]->GetTransitionType(); | 633 ui::PageTransition transition = self.items[index]->GetTransitionType(); |
| 634 return (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) ? YES : NO; | 634 return (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) ? YES : NO; |
| 635 } | 635 } |
| 636 | 636 |
| 637 @end | 637 @end |
| OLD | NEW |