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

Side by Side Diff: ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_article_item.h

Issue 2779843006: Add favicon view to ContentSuggestionsArticle (Closed)
Patch Set: Rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CELLS_CONTENT_SUGGESTIONS_ARTI CLE_ITEM_H_ 5 #ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CELLS_CONTENT_SUGGESTIONS_ARTI CLE_ITEM_H_
6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CELLS_CONTENT_SUGGESTIONS_ARTI CLE_ITEM_H_ 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CELLS_CONTENT_SUGGESTIONS_ARTI CLE_ITEM_H_
7 7
8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" 8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
9 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion _identifier.h" 9 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion _identifier.h"
10 #import "ios/third_party/material_components_ios/src/components/CollectionCells/ src/MaterialCollectionCells.h" 10 #import "ios/third_party/material_components_ios/src/components/CollectionCells/ src/MaterialCollectionCells.h"
11 11
12 namespace base { 12 namespace base {
13 class Time; 13 class Time;
14 } 14 }
15 15
16 @class ContentSuggestionsArticleItem; 16 @class ContentSuggestionsArticleItem;
17 @class FaviconAttributes;
18 @class FaviconViewNew;
17 class GURL; 19 class GURL;
18 20
19 // Delegate for a ContentSuggestionsArticleItem. 21 // Delegate for a ContentSuggestionsArticleItem.
20 @protocol ContentSuggestionsArticleItemDelegate 22 @protocol ContentSuggestionsArticleItemDelegate
21 23
22 // Loads the image associated with this item. 24 // Loads the image associated with this item.
23 - (void)loadImageForArticleItem:(ContentSuggestionsArticleItem*)articleItem; 25 - (void)loadImageForArticleItem:(ContentSuggestionsArticleItem*)articleItem;
24 26
25 @end 27 @end
26 28
(...skipping 10 matching lines...) Expand all
37 url:(const GURL&)url NS_DESIGNATED_INITIALIZER; 39 url:(const GURL&)url NS_DESIGNATED_INITIALIZER;
38 40
39 - (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE; 41 - (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE;
40 42
41 @property(nonatomic, copy, readonly) NSString* title; 43 @property(nonatomic, copy, readonly) NSString* title;
42 @property(nonatomic, strong) UIImage* image; 44 @property(nonatomic, strong) UIImage* image;
43 @property(nonatomic, readonly, assign) GURL articleURL; 45 @property(nonatomic, readonly, assign) GURL articleURL;
44 @property(nonatomic, copy) NSString* publisher; 46 @property(nonatomic, copy) NSString* publisher;
45 @property(nonatomic, assign) base::Time publishDate; 47 @property(nonatomic, assign) base::Time publishDate;
46 @property(nonatomic, weak) id<ContentSuggestionsArticleItemDelegate> delegate; 48 @property(nonatomic, weak) id<ContentSuggestionsArticleItemDelegate> delegate;
49 // Attributes for favicon.
50 @property(nonatomic, strong) FaviconAttributes* attributes;
47 51
48 @end 52 @end
49 53
50 // Corresponding cell for an article in the suggestions. 54 // Corresponding cell for an article in the suggestions.
51 @interface ContentSuggestionsArticleCell : MDCCollectionViewCell 55 @interface ContentSuggestionsArticleCell : MDCCollectionViewCell
52 56
53 @property(nonatomic, readonly, strong) UILabel* titleLabel; 57 @property(nonatomic, readonly, strong) UILabel* titleLabel;
54 @property(nonatomic, readonly, strong) UILabel* subtitleLabel; 58 @property(nonatomic, readonly, strong) UILabel* subtitleLabel;
59 // View for displaying the favicon.
60 @property(nonatomic, readonly, strong) FaviconViewNew* faviconView;
55 61
56 // Sets an |image| to illustrate the article, replacing the "no image" icon. 62 // Sets an |image| to illustrate the article, replacing the "no image" icon.
57 - (void)setContentImage:(UIImage*)image; 63 - (void)setContentImage:(UIImage*)image;
58 64
59 // Sets the publisher |name| and |date|. 65 // Sets the publisher |name| and |date|.
60 - (void)setPublisherName:(NSString*)publisherName date:(base::Time)publishDate; 66 - (void)setPublisherName:(NSString*)publisherName date:(base::Time)publishDate;
61 67
62 @end 68 @end
63 69
64 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CELLS_CONTENT_SUGGESTIONS_A RTICLE_ITEM_H_ 70 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CELLS_CONTENT_SUGGESTIONS_A RTICLE_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698