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

Unified Diff: ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm

Issue 2887433002: Move the ContentSuggestions items to a new target (Closed)
Patch Set: 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/content_suggestions/BUILD.gn ('k') | ios/chrome/browser/ui/content_suggestions/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm b/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
index 8652fde94c6b28151d97628484c6e46877bb3ba7..bdbea41cdb4999d13fd0b058070f9ee82ff0e64a 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
@@ -4,6 +4,7 @@
#import "ios/chrome/browser/content_suggestions/content_suggestions_coordinator.h"
+#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
@@ -123,10 +124,13 @@
commandWithTag:IDC_SHOW_READING_LIST]];
}
-- (void)openURL:(const GURL&)URL {
+- (void)openPageForItem:(CollectionViewItem*)item {
// TODO(crbug.com/691979): Add metrics.
- [self.URLLoader loadURL:URL
+ ContentSuggestionsItem* suggestionItem =
+ base::mac::ObjCCastStrict<ContentSuggestionsItem>(item);
+
+ [self.URLLoader loadURL:suggestionItem.URL
referrer:web::Referrer()
transition:ui::PAGE_TRANSITION_AUTO_BOOKMARK
rendererInitiated:NO];
@@ -134,9 +138,11 @@
[self stop];
}
-- (void)displayContextMenuForArticle:(ContentSuggestionsItem*)articleItem
+- (void)displayContextMenuForArticle:(CollectionViewItem*)item
atPoint:(CGPoint)touchLocation
atIndexPath:(NSIndexPath*)indexPath {
+ ContentSuggestionsItem* articleItem =
+ base::mac::ObjCCastStrict<ContentSuggestionsItem>(item);
self.alertCoordinator = [[ActionSheetCoordinator alloc]
initWithBaseViewController:self.navigationController
title:nil
« no previous file with comments | « ios/chrome/browser/content_suggestions/BUILD.gn ('k') | ios/chrome/browser/ui/content_suggestions/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698