| 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 bea4610b3f01378aee9f95451d9c242bc4274d53..6ab71452369130c9db7571c8ab38708afb17116c 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
|
| @@ -10,6 +10,7 @@
|
| #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_article_item.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_button_item_actions.h"
|
| +#import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_reading_list_item.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_stack_item.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_stack_item_actions.h"
|
| #import "ios/chrome/browser/ui/content_suggestions/cells/expandable_item.h"
|
| @@ -140,6 +141,9 @@ const NSTimeInterval kAnimationDuration = 0.35;
|
| CollectionViewItem* item =
|
| [self.collectionViewModel itemAtIndexPath:indexPath];
|
| switch ([self.collectionUpdater contentSuggestionTypeForItem:item]) {
|
| + case ContentSuggestionTypeReadingList:
|
| + [self openReadingListItem:item];
|
| + break;
|
| case ContentSuggestionTypeArticle:
|
| [self openArticle:item];
|
| break;
|
| @@ -233,6 +237,16 @@ const NSTimeInterval kAnimationDuration = 0.35;
|
| }
|
| }
|
|
|
| +// Opens the Reading List entry associated with |item|. |item| must be a
|
| +// ContentSuggestionsReadingListItem.
|
| +- (void)openReadingListItem:(CollectionViewItem*)item {
|
| + ContentSuggestionsReadingListItem* readingListItem =
|
| + base::mac::ObjCCastStrict<ContentSuggestionsReadingListItem>(item);
|
| + [self.suggestionCommandHandler openURL:readingListItem.url];
|
| +}
|
| +
|
| +// Opens the article associated with |item|. |item| must be a
|
| +// ContentSuggestionsArticleItem.
|
| - (void)openArticle:(CollectionViewItem*)item {
|
| ContentSuggestionsArticleItem* article =
|
| base::mac::ObjCCastStrict<ContentSuggestionsArticleItem>(item);
|
|
|