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_CONTENT_SUGGESTIONS_PROVIDER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 virtual ~ContentSuggestionsProvider(); | 75 virtual ~ContentSuggestionsProvider(); |
76 | 76 |
77 // Determines the status of the given |category|, see CategoryStatus. | 77 // Determines the status of the given |category|, see CategoryStatus. |
78 virtual CategoryStatus GetCategoryStatus(Category category) = 0; | 78 virtual CategoryStatus GetCategoryStatus(Category category) = 0; |
79 | 79 |
80 // Returns the meta information for the given |category|. | 80 // Returns the meta information for the given |category|. |
81 virtual CategoryInfo GetCategoryInfo(Category category) = 0; | 81 virtual CategoryInfo GetCategoryInfo(Category category) = 0; |
82 | 82 |
83 // Dismisses the suggestion with the given ID. A provider needs to ensure that | 83 // Dismisses the suggestion with the given ID. A provider needs to ensure that |
84 // a once-dismissed suggestion is never delivered again (through the | 84 // a once-dismissed suggestion is never delivered again (through the |
85 // Observer). The provider must not call Observer::OnSuggestionsChanged if the | 85 // Observer). The provider must not call Observer::OnNewSuggestions if the |
86 // removal of the dismissed suggestion is the only change. | 86 // removal of the dismissed suggestion is the only change. |
87 virtual void DismissSuggestion( | 87 virtual void DismissSuggestion( |
88 const ContentSuggestion::ID& suggestion_id) = 0; | 88 const ContentSuggestion::ID& suggestion_id) = 0; |
89 | 89 |
90 // Fetches the image for the suggestion with the given ID and returns it | 90 // Fetches the image for the suggestion with the given ID and returns it |
91 // through the callback. This fetch may occur locally or from the internet. | 91 // through the callback. This fetch may occur locally or from the internet. |
92 // If that suggestion doesn't exist, doesn't have an image or if the fetch | 92 // If that suggestion doesn't exist, doesn't have an image or if the fetch |
93 // fails, the callback gets a null image. The callback will not be called | 93 // fails, the callback gets a null image. The callback will not be called |
94 // synchronously. | 94 // synchronously. |
95 virtual void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, | 95 virtual void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 CategoryFactory* category_factory() const { return category_factory_; } | 149 CategoryFactory* category_factory() const { return category_factory_; } |
150 | 150 |
151 private: | 151 private: |
152 Observer* observer_; | 152 Observer* observer_; |
153 CategoryFactory* category_factory_; | 153 CategoryFactory* category_factory_; |
154 }; | 154 }; |
155 | 155 |
156 } // namespace ntp_snippets | 156 } // namespace ntp_snippets |
157 | 157 |
158 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ | 158 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
OLD | NEW |