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

Unified Diff: ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm

Issue 2761263003: Allow CollectionViewModel/Controller queries without SectionIdentifier (Closed)
Patch Set: Cleanup 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/reading_list/reading_list_collection_view_controller.mm
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm
index 60a5e36d872fe20f4bc13b6f1164b5523270549a..0dc1e4e91cd96df6f209c8a293678fbb9cb2b49d 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm
@@ -418,10 +418,8 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
return;
}
- [self
- deleteItemsAtIndexPaths:@[ [self.collectionViewModel
- indexPathForItem:entry
- inSectionWithIdentifier:sectionIdentifier] ]];
+ [self deleteItemsAtIndexPaths:@[ [self.collectionViewModel
+ indexPathForItem:entry] ]];
}
- (void)openEntryInNewTab:(ReadingListCollectionViewItem*)entry {
@@ -465,10 +463,8 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
inSectionWithIdentifier:SectionIdentifierUnread]) {
return;
}
- [self markItemsReadAtIndexPath:@[
- [self.collectionViewModel indexPathForItem:entry
- inSectionWithIdentifier:SectionIdentifierUnread]
- ]];
+ [self markItemsReadAtIndexPath:@[ [self.collectionViewModel
+ indexPathForItem:entry] ]];
}
- (void)markEntryUnread:(ReadingListCollectionViewItem*)entry {
@@ -476,10 +472,8 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
inSectionWithIdentifier:SectionIdentifierRead]) {
return;
}
- [self markItemsUnreadAtIndexPath:@[
- [self.collectionViewModel indexPathForItem:entry
- inSectionWithIdentifier:SectionIdentifierRead]
- ]];
+ [self markItemsUnreadAtIndexPath:@[ [self.collectionViewModel
+ indexPathForItem:entry] ]];
}
#pragma mark - Private methods
@@ -608,8 +602,7 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
}
index++;
}
- [self reconfigureCellsForItems:itemsToReconfigure
- inSectionWithIdentifier:sectionIdentifier];
+ [self reconfigureCellsForItems:itemsToReconfigure];
return NO;
}
@@ -658,17 +651,8 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
strongItem.attributes = attributes;
- for (NSNumber* sectionNumber in
- @[ @(SectionIdentifierUnread), @(SectionIdentifierRead) ]) {
- NSInteger sectionIdentifier = [sectionNumber integerValue];
- if ([strongSelf.collectionViewModel
- hasSectionForSectionIdentifier:sectionIdentifier] &&
- [strongSelf.collectionViewModel hasItem:strongItem
- inSectionWithIdentifier:sectionIdentifier]) {
- [strongSelf reconfigureCellsForItems:@[ strongItem ]
- inSectionWithIdentifier:sectionIdentifier];
- break;
- }
+ if ([strongSelf.collectionViewModel hasItem:strongItem]) {
+ [strongSelf reconfigureCellsForItems:@[ strongItem ]];
}
};

Powered by Google App Engine
This is Rietveld 408576698