OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_CHROME_BROWSER_UI_SUGGESTIONS_SUGGESTIONS_FAVICON_ITEM_H_ | |
6 #define IOS_CHROME_BROWSER_UI_SUGGESTIONS_SUGGESTIONS_FAVICON_ITEM_H_ | |
7 | |
8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | |
9 #import "ios/third_party/material_components_ios/src/components/CollectionCells/ src/MaterialCollectionCells.h" | |
10 | |
11 // Delegate for the SuggestionsFaviconCell, handling the interaction with the | |
12 // inner collection view. | |
13 @protocol SuggestionsFaviconCellDelegate | |
14 | |
15 // Opens the favicon associated with |indexPath|. Called when the inner cell of | |
16 // the SuggestionsFaviconCell at |indexPath| is selected. | |
17 - (void)openFaviconAtIndexPath:(NSIndexPath*)indexPath; | |
lpromero
2017/01/18 09:34:38
No action needed: It might be fine here to pass an
gambard
2017/01/18 12:37:57
Acknowledged.
| |
18 | |
19 @end | |
20 | |
21 // Item for a cell containing favicons in the suggestions. The favicons are | |
22 // presented in an inner collection view contained in the cell associated with | |
23 // this item. The collection view scroll horizontally. | |
lpromero
2017/01/18 09:34:38
scrolls
gambard
2017/01/18 12:37:58
Done.
| |
24 @interface SuggestionsFaviconItem : CollectionViewItem | |
25 | |
26 @property(nonatomic, weak) id<SuggestionsFaviconCellDelegate> delegate; | |
27 | |
28 // Adds a favicon with an |favicon| image and a |title| to this item. | |
lpromero
2017/01/18 09:34:38
s/an/a
gambard
2017/01/18 12:37:57
Done.
| |
29 - (void)addFavicon:(UIImage*)favicon withTitle:(NSString*)title; | |
lpromero
2017/01/18 09:34:38
Should you instead make the API accept an array? I
gambard
2017/01/18 12:37:57
My original intention was to pass an array of data
| |
30 | |
31 @end | |
32 | |
33 // The corresponding cell of a favicon item. | |
34 @interface SuggestionsFaviconCell : MDCCollectionViewCell | |
35 | |
36 // The inner collection view, used to display the favicons. | |
37 @property(nonatomic, strong) UICollectionView* collectionView; | |
38 | |
39 @property(nonatomic, weak) id<SuggestionsFaviconCellDelegate> delegate; | |
40 | |
41 @end | |
42 | |
43 #endif // IOS_CHROME_BROWSER_UI_SUGGESTIONS_SUGGESTIONS_FAVICON_ITEM_H_ | |
OLD | NEW |