| Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm
|
| diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm
|
| index a7aeb51c0269a41ec1c0f6299d941968d70f033a..4749f4f7104e4e5a6e9e991f3c909bb4064cd77b 100644
|
| --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm
|
| +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm
|
| @@ -19,6 +19,7 @@ const CGFloat kStandardSpacing = 8;
|
| @interface ContentSuggestionsArticleItem ()
|
|
|
| @property(nonatomic, copy) NSString* subtitle;
|
| +@property(nonatomic, weak) id<ContentSuggestionsArticleItemDelegate> delegate;
|
|
|
| @end
|
|
|
| @@ -33,25 +34,30 @@ const CGFloat kStandardSpacing = 8;
|
| @synthesize publisher = _publisher;
|
| @synthesize publishDate = _publishDate;
|
| @synthesize suggestionIdentifier = _suggestionIdentifier;
|
| +@synthesize delegate = _delegate;
|
| +@synthesize imageBeingFetched = _imageBeingFetched;
|
|
|
| - (instancetype)initWithType:(NSInteger)type
|
| title:(NSString*)title
|
| subtitle:(NSString*)subtitle
|
| - image:(UIImage*)image
|
| + delegate:(id<ContentSuggestionsArticleItemDelegate>)delegate
|
| url:(const GURL&)url {
|
| self = [super initWithType:type];
|
| if (self) {
|
| self.cellClass = [ContentSuggestionsArticleCell class];
|
| _title = [title copy];
|
| _subtitle = [subtitle copy];
|
| - _image = image;
|
| _articleURL = url;
|
| + _delegate = delegate;
|
| }
|
| return self;
|
| }
|
|
|
| - (void)configureCell:(ContentSuggestionsArticleCell*)cell {
|
| [super configureCell:cell];
|
| + if (!self.image && !self.imageBeingFetched) {
|
| + [self.delegate loadImageForArticleItem:self];
|
| + }
|
| cell.titleLabel.text = _title;
|
| cell.subtitleLabel.text = _subtitle;
|
| cell.imageView.image = _image;
|
|
|