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

Unified Diff: components/ntp_snippets/breaking_news/breaking_news_suggestions_provider.h

Issue 2925053003: [NTP::Push] Adding BreakingNewsSuggestionsProvider (Closed)
Patch Set: Created 3 years, 6 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/breaking_news/breaking_news_suggestions_provider.h
diff --git a/components/ntp_snippets/breaking_news/breaking_news_suggestions_provider.h b/components/ntp_snippets/breaking_news/breaking_news_suggestions_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef37eb5b743d50b661eb1c1df74710431bb3c0da
--- /dev/null
+++ b/components/ntp_snippets/breaking_news/breaking_news_suggestions_provider.h
@@ -0,0 +1,59 @@
+
sfiera 2017/06/07 13:58:15 Nit:
mamir 2017/06/08 09:58:28 Done.
+// 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_REMOTE_BREAKING_NEWS_SUGGESTIONS_PROVIDER_H_
sfiera 2017/06/07 13:58:15 Should have another BREAKING_NEWS_, I think?
mamir 2017/06/08 09:58:28 Done.
+#define COMPONENTS_NTP_SNIPPETS_REMOTE_BREAKING_NEWS_SUGGESTIONS_PROVIDER_H_
+
+#include "components/ntp_snippets/category.h"
+#include "components/ntp_snippets/content_suggestions_provider.h"
+#include "components/prefs/pref_registry_simple.h"
+
+class PrefRegistrySimple;
+namespace ntp_snippets {
+class ContentSuggestionsGCMAppHandler;
+}
+
+namespace ntp_snippets {
+
+// Receives breaking news suggestions via GCM push messages, stores them and
+// provides them as content suggestions.
+class BreakingNewsSuggestionsProvider : public ContentSuggestionsProvider {
+ public:
+ BreakingNewsSuggestionsProvider(
+ ContentSuggestionsProvider::Observer* observer,
+ std::unique_ptr<ContentSuggestionsGCMAppHandler> gcm_app_handler);
+ virtual ~BreakingNewsSuggestionsProvider();
+
+ static void RegisterProfilePrefs(PrefRegistrySimple* registry);
sfiera 2017/06/07 13:58:14 Not implemented
mamir 2017/06/08 09:58:28 Done.
+
+ private:
+ std::unique_ptr<ContentSuggestionsGCMAppHandler> gcm_app_handler_;
sfiera 2017/06/07 13:58:14 Methods before member variables
mamir 2017/06/08 09:58:28 Done.
+ const Category provided_category_;
+
+ // 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;
+
+ CategoryStatus category_status_;
+};
+
+} // namespace ntp_snippets
+
+#endif // COMPONENTS_NTP_SNIPPETS_REMOTE_BREAKING_NEWS_SUGGESTIONS_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698