| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/offline_pages/core/prefetch/prefetch_gcm_handler.h" | 11 #include "components/offline_pages/core/prefetch/prefetch_gcm_handler.h" |
| 12 #include "components/offline_pages/core/prefetch/prefetch_service.h" | 12 #include "components/offline_pages/core/prefetch/prefetch_service.h" |
| 13 #include "components/offline_pages/core/prefetch/suggested_articles_observer.h" | 13 #include "components/offline_pages/core/prefetch/suggested_articles_observer.h" |
| 14 | 14 |
| 15 namespace ntp_snippets { | 15 namespace ntp_snippets { |
| 16 class ContentSuggestionsService; | 16 class ContentSuggestionsService; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace offline_pages { | 19 namespace offline_pages { |
| 20 | 20 |
| 21 class PrefetchServiceImpl : public PrefetchService { | 21 class PrefetchServiceImpl : public PrefetchService { |
| 22 public: | 22 public: |
| 23 PrefetchServiceImpl( | 23 PrefetchServiceImpl( |
| 24 std::unique_ptr<OfflineMetricsCollector> offline_metrics_collector, |
| 25 std::unique_ptr<PrefetchDispatcher> dispatcher, |
| 24 std::unique_ptr<PrefetchGCMHandler> gcm_handler, | 26 std::unique_ptr<PrefetchGCMHandler> gcm_handler, |
| 25 std::unique_ptr<OfflineMetricsCollector> offline_metrics_collector); | 27 std::unique_ptr<PrefetchStore> store); |
| 26 ~PrefetchServiceImpl() override; | 28 ~PrefetchServiceImpl() override; |
| 27 | 29 |
| 28 // PrefetchService implementation: | 30 // PrefetchService implementation: |
| 31 OfflineMetricsCollector* GetOfflineMetricsCollector() override; |
| 32 PrefetchDispatcher* GetPrefetchDispatcher() override; |
| 33 PrefetchGCMHandler* GetPrefetchGCMHandler() override; |
| 34 PrefetchStore* GetPrefetchStore() override; |
| 29 void ObserveContentSuggestionsService( | 35 void ObserveContentSuggestionsService( |
| 30 ntp_snippets::ContentSuggestionsService* service) override; | 36 ntp_snippets::ContentSuggestionsService* service) override; |
| 31 PrefetchDispatcher* GetDispatcher() override; | |
| 32 OfflineMetricsCollector* GetOfflineMetricsCollector() override; | |
| 33 PrefetchGCMHandler* GetPrefetchGCMHandler() override; | |
| 34 | 37 |
| 35 // KeyedService implementation: | 38 // KeyedService implementation: |
| 36 void Shutdown() override; | 39 void Shutdown() override; |
| 37 | 40 |
| 38 private: | 41 private: |
| 42 std::unique_ptr<OfflineMetricsCollector> offline_metrics_collector_; |
| 43 std::unique_ptr<PrefetchDispatcher> prefetch_dispatcher_; |
| 44 std::unique_ptr<PrefetchGCMHandler> prefetch_gcm_handler_; |
| 45 std::unique_ptr<PrefetchStore> prefetch_store_; |
| 39 std::unique_ptr<SuggestedArticlesObserver> suggested_articles_observer_; | 46 std::unique_ptr<SuggestedArticlesObserver> suggested_articles_observer_; |
| 40 std::unique_ptr<PrefetchGCMHandler> gcm_handler_; | |
| 41 std::unique_ptr<PrefetchDispatcher> dispatcher_; | |
| 42 std::unique_ptr<OfflineMetricsCollector> offline_metrics_collector_; | |
| 43 | 47 |
| 44 DISALLOW_COPY_AND_ASSIGN(PrefetchServiceImpl); | 48 DISALLOW_COPY_AND_ASSIGN(PrefetchServiceImpl); |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 } // namespace offline_pages | 51 } // namespace offline_pages |
| 48 | 52 |
| 49 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ | 53 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_IMPL_H_ |
| OLD | NEW |