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

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

Issue 2891363002: Add long press actions for Most Visited tiles (Closed)
Patch Set: Reviewable 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
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 1863075eb533f2d29c60e658e20ac9610cab71e2..3f4bb8b747f8630f5d3ceb3b12ed9298db177afb 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
@@ -251,16 +251,25 @@ using CSCollectionViewItem = CollectionViewItem<SuggestedContent>;
CollectionViewItem* touchedItem =
[self.collectionViewModel itemAtIndexPath:touchedItemIndexPath];
- if ([self.collectionUpdater contentSuggestionTypeForItem:touchedItem] !=
- ContentSuggestionTypeArticle) {
- // Only trigger context menu on articles.
- return;
+ ContentSuggestionType type =
+ [self.collectionUpdater contentSuggestionTypeForItem:touchedItem];
+ switch (type) {
+ case ContentSuggestionTypeArticle:
+ [self.suggestionCommandHandler
+ displayContextMenuForArticle:touchedItem
+ atPoint:touchLocation
+ atIndexPath:touchedItemIndexPath];
+ break;
+ case ContentSuggestionTypeMostVisited:
+ [self.suggestionCommandHandler
+ displayContextMenuForMostVisitedItem:touchedItem
+ atPoint:touchLocation
+ atIndexPath:touchedItemIndexPath];
+ break;
+ default:
+ break;
}
- [self.suggestionCommandHandler
- displayContextMenuForArticle:touchedItem
- atPoint:touchLocation
- atIndexPath:touchedItemIndexPath];
}
// Checks if the |section| is empty and add an empty element if it is the case.

Powered by Google App Engine
This is Rietveld 408576698