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

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

Issue 2689953003: Add Category wrapper for ContentSuggestions on iOS (Closed)
Patch Set: Add comments Created 3 years, 10 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
(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 and its items.
13 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionLayout) {
14 // Follows the card layout.
15 ContentSuggestionsSectionLayoutCard,
16 // No specific layout.
17 ContentSuggestionsSectionLayoutCustom,
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.
stkhapugin 2017/02/13 15:42:49 nit: I know it looks obvious, but can you add a co
gambard 2017/02/13 16:28:02 Done.
23 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionID) {
24 ContentSuggestionsSectionBookmarks = 0,
25 ContentSuggestionsSectionArticles = 1,
26
27 // Do not use this. It will trigger a DCHECK.
28 // Do not add value after this one.
29 ContentSuggestionsSectionCount
30 };
31
32 // Contains the information needed to display the section.
33 @interface ContentSuggestionsSectionInformation : NSObject
34
35 - (instancetype)initWithID:(ContentSuggestionsSectionID)ID;
36 - (instancetype)init NS_UNAVAILABLE;
37
38 // Item to display when the section is empty. If nil the section should not be
39 // displayed when empty.
40 @property(nonatomic, strong) CollectionViewItem* emptyCell;
stkhapugin 2017/02/13 15:42:49 optional: I'm almost certain you will never write
gambard 2017/02/13 16:28:00 Done.
41 // Layout to display the content of the section.
42 @property(nonatomic, assign) ContentSuggestionsSectionLayout layout;
stkhapugin 2017/02/13 15:42:49 Optional: same here, I'm almost sure you'll never
gambard 2017/02/13 16:28:01 Done.
43 // ID of the section. Used for ordering.
44 @property(nonatomic, assign, readonly) ContentSuggestionsSectionID ID;
45 // Title for the section.
46 @property(nonatomic, copy) NSString* title;
stkhapugin 2017/02/13 15:42:49 Optional: And this one.
gambard 2017/02/13 16:28:01 Done.
47
48 @end
49
50 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_SECTION _INFORMATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698