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

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: Move Content Suggestions Observer to //components/offline_pages/core and modify lifetime management 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 13f0eb3f40502706ad1a1fe7f2d6503c5f811f87..e7f49fdeccf5e70d813de856a226ee7c3a3cf6d8 100644
--- a/components/offline_pages/core/prefetch/prefetch_service_impl.cc
+++ b/components/offline_pages/core/prefetch/prefetch_service_impl.cc
@@ -3,12 +3,21 @@
// found in the LICENSE file.
#include "components/offline_pages/core/prefetch/prefetch_service_impl.h"
+#include "base/memory/ptr_util.h"
namespace offline_pages {
-PrefetchServiceImpl::PrefetchServiceImpl() {}
+PrefetchServiceImpl::PrefetchServiceImpl(
+ std::unique_ptr<GCMAppHandler> gcm_app_handler)
+ : gcm_app_handler_(std::move(gcm_app_handler)) {}
PrefetchServiceImpl::~PrefetchServiceImpl() = default;
+void PrefetchServiceImpl::ObserveContentSuggestionsService(
+ ntp_snippets::ContentSuggestionsService* service) {
+ suggested_articles_observer_ =
+ base::MakeUnique<SuggestedArticlesObserver>(service, this);
+}
+
void PrefetchServiceImpl::AddCandidatePrefetchURLs(
const std::vector<PrefetchURL>& url_suggestions) {
NOTIMPLEMENTED();

Powered by Google App Engine
This is Rietveld 408576698