Chromium Code Reviews| 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_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_SECTION_IN FORMATION_H_ | |
| 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_SECTION_IN FORMATION_H_ | |
| 7 | |
| 8 #import <Foundation/Foundation.h> | |
| 9 | |
| 10 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | |
| 11 | |
| 12 // Layout for the section. | |
|
stkhapugin
2017/02/13 12:19:18
Is it "layout for the section" (= the way this sec
gambard
2017/02/13 14:51:41
Done.
| |
| 13 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionLayout) { | |
| 14 // No specific layout. | |
|
stkhapugin
2017/02/13 12:19:18
Optional: Does this match some other enum? Somehow
gambard
2017/02/13 14:51:41
Not really. In the current implementation card = M
| |
| 15 ContentSuggestionsSectionLayoutCustom, | |
| 16 // Follows the card layout. | |
| 17 ContentSuggestionsSectionLayoutCard | |
| 18 }; | |
| 19 | |
| 20 // This enum is used for ordering the sections and as ID for the section. Make | |
| 21 // all sections in the same collection have different ID. | |
| 22 // When adding a new kind of suggestions, add a new corresponding section. | |
| 23 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionID) { | |
| 24 ContentSuggestionsSectionBookmarks = 0, | |
| 25 ContentSuggestionsSectionArticles = 1, | |
| 26 | |
| 27 // Do not use this. It will trigger a DCHECK. | |
| 28 ContentSuggestionsSectionNotImplemented | |
|
stkhapugin
2017/02/13 12:19:18
nit: make this "ContentSuggestionsSectionCount" an
gambard
2017/02/13 14:51:41
Done.
| |
| 29 }; | |
| 30 | |
| 31 // Contains the information needed to display the section. | |
| 32 @interface ContentSuggestionsSectionInformation : NSObject | |
| 33 | |
| 34 - (instancetype)initWithID:(ContentSuggestionsSectionID)ID; | |
| 35 - (instancetype)init NS_UNAVAILABLE; | |
| 36 | |
| 37 // If this not nil, the section is displaying this cell when it is empty. | |
|
lpromero
2017/02/13 12:34:55
"If this is not nil"
gambard
2017/02/13 14:51:41
Done.
| |
| 38 // If it is nil, the section is not displayed when empty. | |
|
lpromero
2017/02/13 12:34:55
No action needed: Technically, these comments are
gambard
2017/02/13 14:51:41
I rewrote the comment.
| |
| 39 @property(nonatomic, strong) CollectionViewItem* emptyCell; | |
| 40 // Layout to display the content of the section. | |
| 41 @property(nonatomic, assign) ContentSuggestionsSectionLayout layout; | |
| 42 // ID of the section. Used for ordering. | |
| 43 @property(nonatomic, assign, readonly) ContentSuggestionsSectionID ID; | |
| 44 // Title for the section. | |
| 45 @property(nonatomic, copy) NSString* title; | |
| 46 | |
| 47 @end | |
| 48 | |
| 49 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_SECTION _INFORMATION_H_ | |
| OLD | NEW |