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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« 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