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

Unified Diff: ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm

Issue 2745593002: Remove categories notified as invalid (Closed)
Patch Set: Add comment Created 3 years, 9 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 | « ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
index 25a4d97419857a9596cf1e5679b6fef0f1dc162d..fc6137156993d22a183cf6da93908d76f00d19f6 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
@@ -66,7 +66,25 @@ const NSTimeInterval kAnimationDuration = 0.35;
[self.collectionView deleteItemsAtIndexPaths:@[ indexPath ]];
}
completion:^(BOOL) {
- // The context menu could be displayed for the delete entry.
+ // The context menu could be displayed for the deleted entry.
+ [self.suggestionCommandHandler dismissContextMenu];
+ }];
+}
+
+- (void)dismissSection:(NSInteger)section {
+ if (section >= [self numberOfSectionsInCollectionView:self.collectionView]) {
+ return;
+ }
+
+ NSInteger sectionIdentifier =
+ [self.collectionViewModel sectionIdentifierForSection:section];
+
+ [self.collectionView performBatchUpdates:^{
+ [self.collectionViewModel removeSectionWithIdentifier:sectionIdentifier];
+ [self.collectionView deleteSections:[NSIndexSet indexSetWithIndex:section]];
+ }
+ completion:^(BOOL) {
+ // The context menu could be displayed for the deleted entries.
[self.suggestionCommandHandler dismissContextMenu];
}];
}
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698