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

Unified Diff: components/offline_pages/core/prefetch/prefetch_service_impl.cc

Issue 2864293003: [Offline Pages] Add a GCMAppHandler for offline page prefetch. (Closed)
Patch Set: Fix windows Created 3 years, 7 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/offline_pages/core/prefetch/prefetch_service_impl.cc
diff --git a/components/offline_pages/core/prefetch/prefetch_service_impl.cc b/components/offline_pages/core/prefetch/prefetch_service_impl.cc
index 9e86aba0b591bdd968aaa7e42cfabc1545323a42..bf3a027195a9ecb01b0cc1d8dc8bc83e0c701c88 100644
--- a/components/offline_pages/core/prefetch/prefetch_service_impl.cc
+++ b/components/offline_pages/core/prefetch/prefetch_service_impl.cc
@@ -11,14 +11,26 @@
namespace offline_pages {
-PrefetchServiceImpl::PrefetchServiceImpl()
- : dispatcher_(base::MakeUnique<PrefetchDispatcherImpl>()) {}
+PrefetchServiceImpl::PrefetchServiceImpl(
+ std::unique_ptr<PrefetchGCMHandler> gcm_handler)
+ : gcm_handler_(std::move(gcm_handler)),
+ dispatcher_(base::MakeUnique<PrefetchDispatcherImpl>()) {}
PrefetchServiceImpl::~PrefetchServiceImpl() = default;
+PrefetchGCMHandler* PrefetchServiceImpl::GetPrefetchGCMHandler() {
+ return gcm_handler_.get();
+}
+
PrefetchDispatcher* PrefetchServiceImpl::GetDispatcher() {
return dispatcher_.get();
-};
+}
+
+void PrefetchServiceImpl::ObserveContentSuggestionsService(
+ ntp_snippets::ContentSuggestionsService* service) {
+ suggested_articles_observer_ =
+ base::MakeUnique<SuggestedArticlesObserver>(service, this);
+}
void PrefetchServiceImpl::Shutdown() {}

Powered by Google App Engine
This is Rietveld 408576698