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

Unified Diff: ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm

Issue 2798563002: Add MostVistedSites to ContentSuggestionsMediator (Closed)
Patch Set: Reviewable 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
index c87d9bf8854e1189dde65d5d545d71d8682e5b14..754c0bede4844a5addf2988bb8c0756b7e21e5bd 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
@@ -52,12 +52,14 @@ typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeHeader,
ItemTypeEmpty,
ItemTypeReadingList,
+ ItemTypeMostVisited,
};
typedef NS_ENUM(NSInteger, SectionIdentifier) {
SectionIdentifierBookmarks = kSectionIdentifierEnumZero,
SectionIdentifierArticles,
SectionIdentifierReadingList,
+ SectionIdentifierMostVisited,
SectionIdentifierDefault,
};
@@ -70,6 +72,8 @@ ItemType ItemTypeForContentSuggestionType(ContentSuggestionType type) {
return ItemTypeEmpty;
case ContentSuggestionTypeReadingList:
return ItemTypeReadingList;
+ case ContentSuggestionTypeMostVisited:
+ return ItemTypeMostVisited;
}
}
@@ -80,6 +84,8 @@ ContentSuggestionType ContentSuggestionTypeForItemType(NSInteger type) {
return ContentSuggestionTypeEmpty;
if (type == ItemTypeReadingList)
return ContentSuggestionTypeReadingList;
+ if (type == ItemTypeMostVisited)
+ return ContentSuggestionTypeMostVisited;
// Add new type here
// Default type.
@@ -99,6 +105,9 @@ SectionIdentifier SectionIdentifierForInfo(
case ContentSuggestionsSectionReadingList:
return SectionIdentifierReadingList;
+ case ContentSuggestionsSectionMostVisited:
+ return SectionIdentifierMostVisited;
+
case ContentSuggestionsSectionUnknown:
return SectionIdentifierDefault;
}
@@ -211,6 +220,14 @@ SectionIdentifier SectionIdentifierForInfo(
[self.collectionViewController dismissSection:section];
}
+- (void)reloadSection:(ContentSuggestionsSectionInformation*)sectionInfo {
+ // TODO(crbug.com/707754): implement this method.
+}
+
+- (void)faviconAvailableForURL:(const GURL&)URL {
+ // TODO(crbug.com/707754): implement this method.
+}
+
#pragma mark - Public methods
- (BOOL)shouldUseCustomStyleForSection:(NSInteger)section {
@@ -290,6 +307,10 @@ SectionIdentifier SectionIdentifierForInfo(
[indexPaths addObject:addedIndexPath];
break;
}
+ case ContentSuggestionTypeMostVisited: {
+ // TODO(crbug.com/707754): Add the most visited item.
+ break;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698