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

Unified Diff: components/ntp_snippets/breaking_news/content_suggestions_gcm_app_handler.cc

Issue 2925053003: [NTP::Push] Adding BreakingNewsSuggestionsProvider (Closed)
Patch Set: sfiera@ comments. 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/content_suggestions_gcm_app_handler.cc
diff --git a/components/ntp_snippets/breaking_news/content_suggestions_gcm_app_handler.cc b/components/ntp_snippets/breaking_news/content_suggestions_gcm_app_handler.cc
index 9e40a220bbae41106f3304591970ba1c278e4733..73531a051e3527025bb156e15cd762282b3fcd0c 100644
--- a/components/ntp_snippets/breaking_news/content_suggestions_gcm_app_handler.cc
+++ b/components/ntp_snippets/breaking_news/content_suggestions_gcm_app_handler.cc
@@ -47,12 +47,14 @@ ContentSuggestionsGCMAppHandler::~ContentSuggestionsGCMAppHandler() {
}
}
-void ContentSuggestionsGCMAppHandler::StartListening() {
+void ContentSuggestionsGCMAppHandler::StartListening(
+ OnNewContentCallback on_new_content_callback) {
#if !defined(OS_ANDROID)
NOTREACHED()
<< "The ContentSuggestionsGCMAppHandler should only be used on Android.";
#endif
Subscribe();
+ on_new_content_callback_ = std::move(on_new_content_callback);
gcm_driver_->AddAppHandler(kContentSuggestionsGCMAppID, this);
}
@@ -112,7 +114,8 @@ void ContentSuggestionsGCMAppHandler::OnStoreReset() {
void ContentSuggestionsGCMAppHandler::OnMessage(
const std::string& app_id,
const gcm::IncomingMessage& message) {
- // TODO(mamir): Implement Show notification and update the feed.
+ // TODO(mamir): Build the message.
+ on_new_content_callback_.Run(std::string());
}
void ContentSuggestionsGCMAppHandler::OnMessagesDeleted(

Powered by Google App Engine
This is Rietveld 408576698