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

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

Issue 2895173003: Fixing glitch about Sign-in promo height in bookmarks (Closed)
Patch Set: Current Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm b/ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm
index 914292f67bf771bc6c28cc50d36f1b0d7eb7955f..719eb3635515406aecefc30fe71b6e1afafa06b5 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm
@@ -545,11 +545,6 @@ CGSize PreferredCellSizeForWidth(UICollectionViewCell* cell, CGFloat width) {
configurator:(SigninPromoViewConfigurator*)
configurator {
DCHECK(_signinPromoViewMediator);
- if (newIdentity) {
- NSIndexSet* indexSet = [NSIndexSet indexSetWithIndex:self.promoSection];
- [self.collectionView reloadSections:indexSet];
- return;
- }
NSIndexPath* indexPath =
[NSIndexPath indexPathForRow:0 inSection:self.promoSection];
BookmarkSigninPromoCell* signinPromoCell =
@@ -557,7 +552,15 @@ CGSize PreferredCellSizeForWidth(UICollectionViewCell* cell, CGFloat width) {
[self.collectionView cellForItemAtIndexPath:indexPath]);
if (!signinPromoCell)
return;
+ // Should always reconfigure the cell size even if it has to be reloaded.
+ // -[BookmarkFolderCollectionView cellSizeForIndexPath:] uses the current
+ // cell to compute its height.
[configurator configureSigninPromoView:signinPromoCell.signinPromoView];
+ if (newIdentity) {
+ // The section should be reload to update the cell height.
+ NSIndexSet* indexSet = [NSIndexSet indexSetWithIndex:self.promoSection];
+ [self.collectionView reloadSections:indexSet];
+ }
}
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698