Chromium Code Reviews| Index: components/offline_pages/core/prefetch/prefetch_service_impl.h |
| diff --git a/components/offline_pages/core/prefetch/prefetch_service_impl.h b/components/offline_pages/core/prefetch/prefetch_service_impl.h |
| index 69346aa356ad721f13d34b818cdb714cced3531d..3845c47ea84cdebdf33a50d67177b98d2eca37c7 100644 |
| --- a/components/offline_pages/core/prefetch/prefetch_service_impl.h |
| +++ b/components/offline_pages/core/prefetch/prefetch_service_impl.h |
| @@ -5,19 +5,37 @@ |
| #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ |
| #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ |
| -#include <vector> |
| +#include <memory> |
| #include "components/offline_pages/core/prefetch/prefetch_service.h" |
| +#include "components/offline_pages/core/prefetch/suggested_articles_observer.h" |
| #include "url/gurl.h" |
| +namespace ntp_snippets { |
| +class ContentSuggestionsService; |
| +} |
| + |
| namespace offline_pages { |
| class PrefetchServiceImpl : public PrefetchService { |
| public: |
| - PrefetchServiceImpl(); |
| + // An interface allowing the prefetch service to hold a GCM App Handler for |
| + // lifetime purposes. TODO(dewittj): Add an interface method for getting an |
|
fgorski
2017/05/17 23:15:02
This comment is duplicated below, please remove on
dewittj
2017/05/22 22:00:08
Done.
|
| + // InstandID token. |
| + class GCMAppHandler { |
| + public: |
| + virtual ~GCMAppHandler() = default; |
| + |
| + // TODO(dewittj): Add methods for acquiring an Instance ID token to this |
| + // interface. |
| + }; |
| + |
| + explicit PrefetchServiceImpl(std::unique_ptr<GCMAppHandler> gcm_app_handler); |
| ~PrefetchServiceImpl() override; |
| // PrefetchService implementation: |
| + void ObserveContentSuggestionsService( |
| + ntp_snippets::ContentSuggestionsService* service) override; |
| void AddCandidatePrefetchURLs( |
| const std::vector<PrefetchURL>& suggested_urls) override; |
| void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override; |
| @@ -29,6 +47,9 @@ class PrefetchServiceImpl : public PrefetchService { |
| void Shutdown() override; |
| private: |
| + std::unique_ptr<SuggestedArticlesObserver> suggested_articles_observer_; |
| + std::unique_ptr<GCMAppHandler> gcm_app_handler_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PrefetchServiceImpl); |
| }; |