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

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: Address comments 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 | « ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.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 11a58eb11d050b92f77f558c237f986c27a4a4c0..23298c0c99e6e6ec18cda03dad3fb639fecfb5a9 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
@@ -248,16 +248,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.
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698