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

Unified Diff: ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm

Issue 2796273002: Display offline availability on ContentSuggestions (Closed)
Patch Set: Adress comments 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
« no previous file with comments | « ios/chrome/browser/content_suggestions/BUILD.gn ('k') | ios/chrome/browser/ui/content_suggestions/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
index 15c36ba9e8e5c4696a7ffc4a855132149a5f1a5e..1b3bf52abc023f9989ab4d67db68a61383598350 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
@@ -11,6 +11,7 @@
#include "components/ntp_snippets/category.h"
#include "components/ntp_snippets/category_info.h"
#include "components/ntp_snippets/content_suggestion.h"
+#include "components/ntp_snippets/reading_list/reading_list_distillation_state_util.h"
#import "ios/chrome/browser/content_suggestions/content_suggestions_category_wrapper.h"
#import "ios/chrome/browser/content_suggestions/content_suggestions_service_bridge_observer.h"
#import "ios/chrome/browser/content_suggestions/mediator_util.h"
@@ -20,6 +21,8 @@
#import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.h"
#import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestions_section_information.h"
#import "ios/chrome/browser/ui/favicon/favicon_attributes_provider.h"
+#import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_item.h"
+#import "ios/chrome/browser/ui/reading_list/reading_list_utils.h"
#include "ui/gfx/image/image.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -268,6 +271,16 @@ initWithContentService:(ntp_snippets::ContentSuggestionsService*)contentService
suggestion.suggestionIdentifier.sectionInfo =
self.sectionInformationByCategory[categoryWrapper];
+ if (category.IsKnownCategory(ntp_snippets::KnownCategories::READING_LIST)) {
+ ReadingListUIDistillationStatus status =
+ reading_list::UIStatusFromModelStatus(
+ ReadingListStateFromSuggestionState(
+ contentSuggestion.reading_list_suggestion_extra()
+ ->distilled_state));
+ suggestion.readingListExtra = [ContentSuggestionReadingListExtra
+ extraWithDistillationStatus:status];
+ }
+
[contentArray addObject:suggestion];
}
« no previous file with comments | « ios/chrome/browser/content_suggestions/BUILD.gn ('k') | ios/chrome/browser/ui/content_suggestions/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698