OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // ====== New Architecture ===== | 5 // ====== New Architecture ===== |
6 // = This code is only used in the new iOS Chrome architecture. = | 6 // = This code is only used in the new iOS Chrome architecture. = |
7 // ============================================================================ | 7 // ============================================================================ |
8 | 8 |
9 #import "ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.h" | 9 #import "ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.h" |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 - (TabSwitcherCache*)tabSwitcherCache { | 150 - (TabSwitcherCache*)tabSwitcherCache { |
151 // PLACEHOLDER: return image cache. | 151 // PLACEHOLDER: return image cache. |
152 return nil; | 152 return nil; |
153 } | 153 } |
154 | 154 |
155 - (void)cellPressed:(UICollectionViewCell*)cell { | 155 - (void)cellPressed:(UICollectionViewCell*)cell { |
156 [self.tabCommandHandler showTabAtIndexPath:[self.grid indexPathForCell:cell]]; | 156 [self.tabCommandHandler showTabAtIndexPath:[self.grid indexPathForCell:cell]]; |
157 } | 157 } |
158 | 158 |
159 - (void)deleteButtonPressedForCell:(UICollectionViewCell*)cell { | 159 - (void)deleteButtonPressedForCell:(UICollectionViewCell*)cell { |
160 // PLACEHOLDER: handle close tab button. | 160 auto updateBlock = ^{ |
| 161 NSIndexPath* indexPath = [self.grid indexPathForCell:cell]; |
| 162 [self.tabCommandHandler closeTabAtIndexPath:indexPath]; |
| 163 [self.grid deleteItemsAtIndexPaths:@[ indexPath ]]; |
| 164 }; |
| 165 [self.grid performBatchUpdates:updateBlock completion:nil]; |
161 } | 166 } |
162 | 167 |
163 @end | 168 @end |
OLD | NEW |