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

Unified Diff: ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.mm

Issue 2786893002: [ios] Dispatcher for tab_strip and tab_grid. (Closed)
Patch Set: Created 3 years, 9 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
Index: ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.mm
diff --git a/ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.mm b/ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.mm
index 3d627cb4bf3c3f30cf2aff46997cf7baf534d6f5..76f4433b60641ff586587312b247809e591bbe14 100644
--- a/ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.mm
+++ b/ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.mm
@@ -5,7 +5,6 @@
#import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.h"
#include "base/mac/foundation_util.h"
-#import "ios/clean/chrome/browser/ui/commands/tab_commands.h"
#import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_data_source.h"
#import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_tab_cell.h"
@@ -22,7 +21,6 @@
@implementation TabCollectionViewController
@synthesize tabs = _tabs;
@synthesize dataSource = _dataSource;
-@synthesize tabCommandHandler = _tabCommandHandler;
#pragma mark - UIViewController
@@ -62,6 +60,18 @@
return nil;
}
+- (void)showTabAtIndex:(int)index {
+ [NSException
marq (ping after 24h) 2017/03/30 08:46:18 We prefer not to raise ObjC exceptions (see https:
edchin 2017/03/30 18:15:51 Done.
+ raise:NSInternalInconsistencyException
+ format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];
+}
+
+- (void)closeTabAtIndex:(int)index {
+ [NSException
+ raise:NSInternalInconsistencyException
+ format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];
+}
+
#pragma mark - UICollectionViewDataSource methods
- (NSInteger)numberOfSectionsInCollectionView:
@@ -111,14 +121,14 @@
NSInteger item = [[self.tabs indexPathForCell:cell] item];
DCHECK_LE(item, INT_MAX);
int index = static_cast<int>(item);
- [self.tabCommandHandler showTabAtIndex:index];
+ [self showTabAtIndex:index];
}
- (void)deleteButtonPressedForCell:(UICollectionViewCell*)cell {
NSInteger item = [[self.tabs indexPathForCell:cell] item];
DCHECK_LE(item, INT_MAX);
int index = static_cast<int>(item);
- [self.tabCommandHandler closeTabAtIndex:index];
+ [self closeTabAtIndex:index];
}
#pragma mark - TabCollectionConsumer methods

Powered by Google App Engine
This is Rietveld 408576698