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

Unified Diff: components/ntp_snippets/ios/reading_list_suggestions_provider.h

Issue 2755113002: Create ReadingListSuggestionsProvider (Closed)
Patch Set: Created 3 years, 9 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: components/ntp_snippets/ios/reading_list_suggestions_provider.h
diff --git a/components/ntp_snippets/ios/reading_list_suggestions_provider.h b/components/ntp_snippets/ios/reading_list_suggestions_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..fefaa9ab71bf331c61f7f933370bed99c3d38bac
--- /dev/null
+++ b/components/ntp_snippets/ios/reading_list_suggestions_provider.h
@@ -0,0 +1,57 @@
+// 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 COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H_
Marc Treib 2017/03/17 14:44:01 include guard doesn't match the folder
gambard 2017/03/20 08:32:40 Done.
+#define COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H_
+
+#include "components/ntp_snippets/content_suggestions_provider.h"
Marc Treib 2017/03/17 14:44:01 nit: Some includes missing, e.g. for ContentSugges
gambard 2017/03/20 08:32:40 Done.
+#include "components/reading_list/ios/reading_list_model_observer.h"
Marc Treib 2017/03/17 14:44:01 Ah, this is probably what makes the ios/ subfolder
gambard 2017/03/20 08:32:40 See the other comment.
+
+class ReadingListModel;
+
+namespace ntp_snippets {
+
+// Provides content suggestions from the Reading List.
+class ReadingListSuggestionsProvider : public ContentSuggestionsProvider,
+ public ReadingListModelObserver {
+ public:
+ ReadingListSuggestionsProvider(ContentSuggestionsProvider::Observer* observer,
+ ReadingListModel* reading_list_model);
+
+ private:
+ // ContentSuggestionsProvider implementation.
+ CategoryStatus GetCategoryStatus(Category category) override;
+ CategoryInfo GetCategoryInfo(Category category) override;
+ void DismissSuggestion(const ContentSuggestion::ID& suggestion_id) override;
+ void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id,
+ const ImageFetchedCallback& callback) override;
+ void Fetch(const Category& category,
+ const std::set<std::string>& known_suggestion_ids,
+ const FetchDoneCallback& callback) override;
+ void ClearHistory(
+ base::Time begin,
+ base::Time end,
+ const base::Callback<bool(const GURL& url)>& filter) override;
+ void ClearCachedSuggestions(Category category) override;
+ void GetDismissedSuggestionsForDebugging(
+ Category category,
+ const DismissedSuggestionsCallback& callback) override;
+ void ClearDismissedSuggestionsForDebugging(Category category) override;
+
+ // ReadingListModelObserver implementation.
+ void ReadingListModelLoaded(const ReadingListModel* model) override;
+
+ void FetchReadingListInternal();
+
+ CategoryStatus category_status_;
+ const Category provided_category_;
+
+ ReadingListModel* reading_list_model_;
+
+ DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider);
+};
+
+} // namespace ntp_snippets
+
+#endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698