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

Unified 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 include 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_section_information.h
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_section_information.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_section_information.h
new file mode 100644
index 0000000000000000000000000000000000000000..884b2804ccbad8aaa89a03f5a2920ec79cd292e7
--- /dev/null
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_section_information.h
@@ -0,0 +1,49 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_SECTION_INFORMATION_H_
+#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_SECTION_INFORMATION_H_
+
+#import <Foundation/Foundation.h>
+
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
+
+// 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.
+typedef NS_ENUM(NSInteger, ContentSuggestionsSectionLayout) {
+ // 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
+ ContentSuggestionsSectionLayoutCustom,
+ // Follows the card layout.
+ ContentSuggestionsSectionLayoutCard
+};
+
+// This enum is used for ordering the sections and as ID for the section. Make
+// all sections in the same collection have different ID.
+// When adding a new kind of suggestions, add a new corresponding section.
+typedef NS_ENUM(NSInteger, ContentSuggestionsSectionID) {
+ ContentSuggestionsSectionBookmarks = 0,
+ ContentSuggestionsSectionArticles = 1,
+
+ // Do not use this. It will trigger a DCHECK.
+ ContentSuggestionsSectionNotImplemented
stkhapugin 2017/02/13 12:19:18 nit: make this "ContentSuggestionsSectionCount" an
gambard 2017/02/13 14:51:41 Done.
+};
+
+// Contains the information needed to display the section.
+@interface ContentSuggestionsSectionInformation : NSObject
+
+- (instancetype)initWithID:(ContentSuggestionsSectionID)ID;
+- (instancetype)init NS_UNAVAILABLE;
+
+// 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.
+// 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.
+@property(nonatomic, strong) CollectionViewItem* emptyCell;
+// Layout to display the content of the section.
+@property(nonatomic, assign) ContentSuggestionsSectionLayout layout;
+// ID of the section. Used for ordering.
+@property(nonatomic, assign, readonly) ContentSuggestionsSectionID ID;
+// Title for the section.
+@property(nonatomic, copy) NSString* title;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_SECTION_INFORMATION_H_

Powered by Google App Engine
This is Rietveld 408576698