Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm

Issue 2703633005: [tab_grid] Hack-in close tab. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm
diff --git a/ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm b/ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm
index e5a898075dc9d7c38226d0285f65b1eb7012be63..6296bbe1925abe2f6e98119c66f8d4de537d3fcc 100644
--- a/ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm
+++ b/ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm
@@ -157,7 +157,12 @@ const CGFloat kToolbarHeight = 64.0f;
}
- (void)deleteButtonPressedForCell:(UICollectionViewCell*)cell {
- // PLACEHOLDER: handle close tab button.
+ auto updateBlock = ^{
+ NSIndexPath* indexPath = [self.grid indexPathForCell:cell];
+ [self.tabCommandHandler closeTabAtIndexPath:indexPath];
+ [self.grid deleteItemsAtIndexPaths:@[ indexPath ]];
+ };
+ [self.grid performBatchUpdates:updateBlock completion:nil];
}
@end
« no previous file with comments | « ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698