Chromium Code Reviews| Index: ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm |
| diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm b/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm |
| index 01654b9867960432c4225d6ff1c66d7ce0d16cdb..898a2bbeccdb6cfd8a5c5366818832d18de44059 100644 |
| --- a/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm |
| +++ b/ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm |
| @@ -24,6 +24,7 @@ |
| #import "ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.h" |
| #import "ios/chrome/browser/ui/bookmarks/bookmark_collection_view_background.h" |
| #import "ios/chrome/browser/ui/bookmarks/bookmark_promo_cell.h" |
| +#import "ios/chrome/browser/ui/bookmarks/bookmark_signin_promo_cell.h" |
| #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" |
| #include "ios/chrome/browser/ui/ui_util.h" |
| #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| @@ -196,6 +197,8 @@ const NSTimeInterval kShowEmptyBookmarksBackgroundRefreshDelay = 1.0; |
| withReuseIdentifier:[BookmarkHeaderSeparatorView reuseIdentifier]]; |
| [self.collectionView registerClass:[BookmarkPromoCell class] |
| forCellWithReuseIdentifier:[BookmarkPromoCell reuseIdentifier]]; |
| + [self.collectionView registerClass:[BookmarkSigninPromoCell class] |
| + forCellWithReuseIdentifier:[BookmarkSigninPromoCell reuseIdentifier]]; |
| [self addSubview:self.collectionView]; |
| @@ -686,18 +689,7 @@ const NSTimeInterval kShowEmptyBookmarksBackgroundRefreshDelay = 1.0; |
| } |
| - (CGSize)cellSizeForIndexPath:(NSIndexPath*)indexPath { |
| - if ([self isPromoSection:indexPath.section]) { |
| - CGRect estimatedFrame = CGRectMake(0, 0, CGRectGetWidth(self.bounds), 100); |
| - UICollectionViewCell* cell = |
| - [self.collectionView cellForItemAtIndexPath:indexPath]; |
| - if (!cell) { |
| - cell = [[BookmarkPromoCell alloc] initWithFrame:estimatedFrame]; |
| - } |
| - cell.frame = estimatedFrame; |
| - [cell layoutIfNeeded]; |
| - return [cell systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; |
| - } |
| - |
| + DCHECK(![self isPromoSection:indexPath.section]); |
|
lpromero
2017/04/26 19:03:50
Why is it the case?
jlebel
2017/04/27 09:54:54
I moved it in the subclass so we do the cell size
|
| UIEdgeInsets insets = [self insetForSectionAtIndex:indexPath.section]; |
| return CGSizeMake(self.bounds.size.width - (insets.right + insets.left), |
| rowHeight); |