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

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

Issue 2796273002: Display offline availability on ContentSuggestions (Closed)
Patch Set: Add comment 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/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 930f2111c407ceb44314ac1fdd3327426b30e732..e92935710abae4f36833b83981bf9a02d5dc0c1a 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
@@ -12,6 +12,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/ui/content_suggestions/content_suggestion.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 "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/gfx/image/image.h"
@@ -366,6 +369,15 @@ initWithContentService:(ntp_snippets::ContentSuggestionsService*)contentService
suggestion.suggestionIdentifier.sectionInfo =
self.sectionInformationByCategory[categoryWrapper];
+ if (category.IsKnownCategory(ntp_snippets::KnownCategories::READING_LIST)) {
+ ReadingListUIDistillationStatus status =
+ UIStatusFromModelStatus(ReadingListStateFromSuggestionState(
Olivier 2017/04/05 13:45:22 IIUC, UIStatusFromModelStatus will be a really com
gambard 2017/04/06 09:28:50 Done.
+ contentSuggestion.reading_list_suggestion_extra()
+ ->distilled_state));
Olivier 2017/04/05 14:03:44 I think the real problem (that confuses me most) i
gambard 2017/04/06 09:28:50 Acknowledged.
+ suggestion.readingListExtra =
+ [ContentSuggestionReadingListExtra extraWithStatus:status];
+ }
+
[contentArray addObject:suggestion];
}

Powered by Google App Engine
This is Rietveld 408576698