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

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

Issue 2971093002: [ios] Take snapshot for tab grid. (Closed)
Patch Set: Update unit test. Created 3 years, 5 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 87b9107604610f89762c285bbb91c8ef0dd46387..eb433e9a15ef2c7fd041a28e8824fcce0be42f82 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
@@ -157,6 +157,7 @@
- (void)insertItem:(TabCollectionItem*)item
atIndex:(int)index
selectedIndex:(int)selectedIndex {
+ DCHECK(item);
DCHECK_GE(index, 0);
DCHECK_LE(static_cast<NSUInteger>(index), self.items.count);
[self.items insertObject:item atIndex:index];
@@ -204,4 +205,13 @@
self.selectedIndex = selectedIndex;
}
+- (void)updateSnapshotAtIndex:(int)index {
+ DCHECK_GE(index, 0);
+ DCHECK_LT(static_cast<NSUInteger>(index), self.items.count);
+ TabCollectionTabCell* cell = base::mac::ObjCCastStrict<TabCollectionTabCell>(
+ [self.tabs cellForItemAtIndexPath:[NSIndexPath indexPathForItem:index
+ inSection:0]]);
+ [cell configureCell:self.items[index] snapshotCache:self.snapshotCache];
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698