| 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 DCHECK(index != _lastCommittedItemIndex); | 541 DCHECK(index != _lastCommittedItemIndex); |
| 542 DCHECK(index >= 0); | 542 DCHECK(index >= 0); |
| 543 | 543 |
| 544 [self discardNonCommittedItems]; | 544 [self discardNonCommittedItems]; |
| 545 | 545 |
| 546 _items.erase(_items.begin() + index); | 546 _items.erase(_items.begin() + index); |
| 547 if (_lastCommittedItemIndex > index) | 547 if (_lastCommittedItemIndex > index) |
| 548 _lastCommittedItemIndex--; | 548 _lastCommittedItemIndex--; |
| 549 if (_previousItemIndex >= index) | 549 if (_previousItemIndex >= index) |
| 550 _previousItemIndex--; | 550 _previousItemIndex--; |
| 551 |
| 552 if (_navigationManager) |
| 553 _navigationManager->OnNavigationItemsPruned(1U); |
| 551 } | 554 } |
| 552 | 555 |
| 553 - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem | 556 - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem |
| 554 andItem:(web::NavigationItem*)secondItem { | 557 andItem:(web::NavigationItem*)secondItem { |
| 555 if (!firstItem || !secondItem || firstItem == secondItem) | 558 if (!firstItem || !secondItem || firstItem == secondItem) |
| 556 return NO; | 559 return NO; |
| 557 NSUInteger firstIndex = [self indexOfItem:firstItem]; | 560 NSUInteger firstIndex = [self indexOfItem:firstItem]; |
| 558 NSUInteger secondIndex = [self indexOfItem:secondItem]; | 561 NSUInteger secondIndex = [self indexOfItem:secondItem]; |
| 559 if (firstIndex == NSNotFound || secondIndex == NSNotFound) | 562 if (firstIndex == NSNotFound || secondIndex == NSNotFound) |
| 560 return NO; | 563 return NO; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 return item; | 628 return item; |
| 626 } | 629 } |
| 627 | 630 |
| 628 - (BOOL)isRedirectTransitionForItemAtIndex:(size_t)index { | 631 - (BOOL)isRedirectTransitionForItemAtIndex:(size_t)index { |
| 629 DCHECK_LT(index, self.items.size()); | 632 DCHECK_LT(index, self.items.size()); |
| 630 ui::PageTransition transition = self.items[index]->GetTransitionType(); | 633 ui::PageTransition transition = self.items[index]->GetTransitionType(); |
| 631 return (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) ? YES : NO; | 634 return (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) ? YES : NO; |
| 632 } | 635 } |
| 633 | 636 |
| 634 @end | 637 @end |
| OLD | NEW |