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..2c97c2c514fbb68a4805a73239846026f22b731b |
--- /dev/null |
+++ b/components/ntp_snippets/ios/reading_list_suggestions_provider.h |
@@ -0,0 +1,66 @@ |
+// 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_IOS_READING_LIST_SUGGESTIONS_PROVIDER_H_ |
+#define COMPONENTS_NTP_SNIPPETS_IOS_READING_LIST_SUGGESTIONS_PROVIDER_H_ |
+ |
+#include <set> |
+#include <string> |
+ |
+#include "components/ntp_snippets/callbacks.h" |
+#include "components/ntp_snippets/category.h" |
+#include "components/ntp_snippets/category_info.h" |
+#include "components/ntp_snippets/category_status.h" |
+#include "components/ntp_snippets/content_suggestion.h" |
+#include "components/ntp_snippets/content_suggestions_provider.h" |
+#include "components/reading_list/ios/reading_list_model_observer.h" |
+ |
+class ReadingListModel; |
+ |
+namespace ntp_snippets { |
+ |
+// Provides content suggestions from the Reading List. |
+class ReadingListSuggestionsProvider : public ContentSuggestionsProvider, |
+ public ReadingListModelObserver { |
tschumann
2017/03/20 08:58:13
I wonder if we can avoid having the provider be to
gambard
2017/03/23 15:45:52
I planned to have the support of ReadingListModelO
|
+ public: |
+ ReadingListSuggestionsProvider(ContentSuggestionsProvider::Observer* observer, |
+ ReadingListModel* reading_list_model); |
+ ~ReadingListSuggestionsProvider() override; |
+ |
+ private: |
+ // ContentSuggestionsProvider implementation. |
tschumann
2017/03/20 08:58:13
there was some discussion about artificially (and
Marc Treib
2017/03/20 09:55:26
It depends - things that aren't conceptually part
tschumann
2017/03/20 09:59:58
The problem is that you cannot effecively hide it
gambard
2017/03/23 15:45:52
I set it public.
|
+ 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_IOS_READING_LIST_SUGGESTIONS_PROVIDER_H_ |