Commit 665ff147 authored by edchin's avatar edchin Committed by Chromium LUCI CQ

[ios][DragAndDrop] Additional cleanup

https://crrev.com/c/2581033 missed a few cleanup items.

Bug: 1099646
Change-Id: I4f1fabcade940a977b6b0f0af3ed855b3929eb1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591818
Auto-Submit: edchin <edchin@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837095}
parent 012b87aa
......@@ -77,8 +77,6 @@ NSIndexPath* CreateIndexPath(NSInteger index) {
@property(nonatomic, strong) GridLayout* gridLayout;
// The layout for the thumb strip.
@property(nonatomic, strong) HorizontalLayout* horizontalLayout;
// YES if, the cells have been reordered.
@property(nonatomic, assign) BOOL hasChangedOrder;
// By how much the user scrolled past the view's content size. A negative value
// means the user hasn't scrolled past the end of the scroll view.
@property(nonatomic, assign, readonly) CGFloat offsetPastEndOfScrollView;
......@@ -351,32 +349,6 @@ NSIndexPath* CreateIndexPath(NSInteger index) {
return cell;
}
- (BOOL)collectionView:(UICollectionView*)collectionView
canMoveItemAtIndexPath:(NSIndexPath*)indexPath {
if ([self isIndexPathForPlusSignCell:indexPath]) {
// The PlusSignCell is at the end of the collection and should not be moved.
return NO;
}
return indexPath && self.items.count > 1;
}
- (void)collectionView:(UICollectionView*)collectionView
moveItemAtIndexPath:(NSIndexPath*)sourceIndexPath
toIndexPath:(NSIndexPath*)destinationIndexPath {
NSUInteger source = base::checked_cast<NSUInteger>(sourceIndexPath.item);
NSUInteger destination =
base::checked_cast<NSUInteger>(destinationIndexPath.item);
// Update |items| before informing the delegate, so the state of the UI
// is correctly represented before any updates occur.
TabSwitcherItem* item = self.items[source];
[self.items removeObjectAtIndex:source];
[self.items insertObject:item atIndex:destination];
self.hasChangedOrder = YES;
[self.delegate gridViewController:self
didMoveItemWithID:item.identifier
toIndex:destination];
}
#pragma mark - UICollectionViewDelegate
// This prevents the user from dragging a cell past the plus sign cell (the last
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment