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

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_collection_view.mm

Issue 2838373002: Adding Sign-in promo for bookmark view. (Closed)
Patch Set: From CGFLOAT_MAX to 1000 Created 3 years, 8 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/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]);
UIEdgeInsets insets = [self insetForSectionAtIndex:indexPath.section];
return CGSizeMake(self.bounds.size.width - (insets.right + insets.left),
rowHeight);
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/BUILD.gn ('k') | ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698