| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS
_PROVIDER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS
_PROVIDER_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS
_PROVIDER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS
_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "components/ntp_snippets/category.h" | 13 #include "components/ntp_snippets/category.h" |
| 14 #include "components/ntp_snippets/category_factory.h" | |
| 15 #include "components/ntp_snippets/category_status.h" | 14 #include "components/ntp_snippets/category_status.h" |
| 16 #include "components/ntp_snippets/content_suggestion.h" | 15 #include "components/ntp_snippets/content_suggestion.h" |
| 17 #include "components/ntp_snippets/content_suggestions_provider.h" | 16 #include "components/ntp_snippets/content_suggestions_provider.h" |
| 18 #include "components/physical_web/data_source/physical_web_data_source.h" | 17 #include "components/physical_web/data_source/physical_web_data_source.h" |
| 19 #include "components/physical_web/data_source/physical_web_listener.h" | 18 #include "components/physical_web/data_source/physical_web_listener.h" |
| 20 | 19 |
| 21 class PrefRegistrySimple; | 20 class PrefRegistrySimple; |
| 22 class PrefService; | 21 class PrefService; |
| 23 class GURL; | 22 class GURL; |
| 24 | 23 |
| 25 namespace ntp_snippets { | 24 namespace ntp_snippets { |
| 26 | 25 |
| 27 // Provides content suggestions from the Physical Web Service. | 26 // Provides content suggestions from the Physical Web Service. |
| 28 class PhysicalWebPageSuggestionsProvider | 27 class PhysicalWebPageSuggestionsProvider |
| 29 : public ContentSuggestionsProvider, | 28 : public ContentSuggestionsProvider, |
| 30 public physical_web::PhysicalWebListener { | 29 public physical_web::PhysicalWebListener { |
| 31 public: | 30 public: |
| 32 PhysicalWebPageSuggestionsProvider( | 31 PhysicalWebPageSuggestionsProvider( |
| 33 ContentSuggestionsProvider::Observer* observer, | 32 ContentSuggestionsProvider::Observer* observer, |
| 34 CategoryFactory* category_factory, | |
| 35 physical_web::PhysicalWebDataSource* physical_web_data_source, | 33 physical_web::PhysicalWebDataSource* physical_web_data_source, |
| 36 PrefService* pref_service); | 34 PrefService* pref_service); |
| 37 ~PhysicalWebPageSuggestionsProvider() override; | 35 ~PhysicalWebPageSuggestionsProvider() override; |
| 38 | 36 |
| 39 // ContentSuggestionsProvider implementation. | 37 // ContentSuggestionsProvider implementation. |
| 40 CategoryStatus GetCategoryStatus(Category category) override; | 38 CategoryStatus GetCategoryStatus(Category category) override; |
| 41 CategoryInfo GetCategoryInfo(Category category) override; | 39 CategoryInfo GetCategoryInfo(Category category) override; |
| 42 void DismissSuggestion(const ContentSuggestion::ID& suggestion_id) override; | 40 void DismissSuggestion(const ContentSuggestion::ID& suggestion_id) override; |
| 43 void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, | 41 void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, |
| 44 const ImageFetchedCallback& callback) override; | 42 const ImageFetchedCallback& callback) override; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const Category provided_category_; | 97 const Category provided_category_; |
| 100 physical_web::PhysicalWebDataSource* physical_web_data_source_; | 98 physical_web::PhysicalWebDataSource* physical_web_data_source_; |
| 101 PrefService* pref_service_; | 99 PrefService* pref_service_; |
| 102 | 100 |
| 103 DISALLOW_COPY_AND_ASSIGN(PhysicalWebPageSuggestionsProvider); | 101 DISALLOW_COPY_AND_ASSIGN(PhysicalWebPageSuggestionsProvider); |
| 104 }; | 102 }; |
| 105 | 103 |
| 106 } // namespace ntp_snippets | 104 } // namespace ntp_snippets |
| 107 | 105 |
| 108 #endif // COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTI
ONS_PROVIDER_H_ | 106 #endif // COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTI
ONS_PROVIDER_H_ |
| OLD | NEW |