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

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: Update showcase. 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..8ce5b44e6ca4cf67c686f6cf767f906576376dc5 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
@@ -4,8 +4,9 @@
#import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_view_controller.h"
+#include "base/logging.h"
#include "base/mac/foundation_util.h"
-#import "ios/clean/chrome/browser/ui/commands/tab_commands.h"
+#include "base/strings/sys_string_conversions.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 +23,6 @@
@implementation TabCollectionViewController
@synthesize tabs = _tabs;
@synthesize dataSource = _dataSource;
-@synthesize tabCommandHandler = _tabCommandHandler;
#pragma mark - UIViewController
@@ -56,12 +56,24 @@
#pragma mark - Required subclass override
- (UICollectionViewLayout*)collectionViewLayout {
- [NSException
- raise:NSInternalInconsistencyException
- format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];
+ NOTREACHED() << "You must override "
+ << base::SysNSStringToUTF8(NSStringFromSelector(_cmd))
+ << " in a subclass.";
return nil;
}
+- (void)showTabAtIndex:(int)index {
+ NOTREACHED() << "You must override "
+ << base::SysNSStringToUTF8(NSStringFromSelector(_cmd))
+ << " in a subclass.";
+}
+
+- (void)closeTabAtIndex:(int)index {
+ NOTREACHED() << "You must override "
+ << base::SysNSStringToUTF8(NSStringFromSelector(_cmd))
+ << " in a subclass.";
+}
+
#pragma mark - UICollectionViewDataSource methods
- (NSInteger)numberOfSectionsInCollectionView:
@@ -111,14 +123,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