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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 // categories, and through |OnCategoryStatusChanged| with parameter | 74 // categories, and through |OnCategoryStatusChanged| with parameter |
75 // NOT_PROVIDED for removed categories. | 75 // NOT_PROVIDED for removed categories. |
76 virtual std::vector<Category> GetProvidedCategories() = 0; | 76 virtual std::vector<Category> GetProvidedCategories() = 0; |
77 | 77 |
78 // Determines the status of the given |category|, see CategoryStatus. | 78 // Determines the status of the given |category|, see CategoryStatus. |
79 virtual CategoryStatus GetCategoryStatus(Category category) = 0; | 79 virtual CategoryStatus GetCategoryStatus(Category category) = 0; |
80 | 80 |
81 // Returns the meta information for the given |category|. | 81 // Returns the meta information for the given |category|. |
82 virtual CategoryInfo GetCategoryInfo(Category category) = 0; | 82 virtual CategoryInfo GetCategoryInfo(Category category) = 0; |
83 | 83 |
84 // Triggers a fetch for new suggestions (over the network, for example) for | |
85 // the given |category|. This must be initiated by the user (e.g. by clicking | |
86 // the a "More" button). New suggestions will become available through | |
Marc Treib
2016/08/10 09:40:31
nit: remove "a"
Philipp Keck
2016/08/10 13:14:46
Done.
| |
87 // |Observer::OnNewSuggestions|. | |
88 virtual void FetchMoreSuggestions(Category category) = 0; | |
Marc Treib
2016/08/10 09:40:31
Hm. For now, we don't expect this method to ever a
Philipp Keck
2016/08/10 13:14:46
Acknowledged.
We could, instead, put sth. like a
| |
89 | |
84 // Dismisses the suggestion with the given ID. A provider needs to ensure that | 90 // Dismisses the suggestion with the given ID. A provider needs to ensure that |
85 // a once-dismissed suggestion is never delivered again (through the | 91 // a once-dismissed suggestion is never delivered again (through the |
86 // Observer). The provider must not call Observer::OnSuggestionsChanged if the | 92 // Observer). The provider must not call Observer::OnSuggestionsChanged if the |
87 // removal of the dismissed suggestion is the only change. | 93 // removal of the dismissed suggestion is the only change. |
88 virtual void DismissSuggestion(const std::string& suggestion_id) = 0; | 94 virtual void DismissSuggestion(const std::string& suggestion_id) = 0; |
89 | 95 |
90 // Fetches the image for the suggestion with the given ID and returns it | 96 // 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. | 97 // 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 | 98 // 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 | 99 // fails, the callback gets a null image. The callback will not be called |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 CategoryFactory* category_factory() const { return category_factory_; } | 139 CategoryFactory* category_factory() const { return category_factory_; } |
134 | 140 |
135 private: | 141 private: |
136 Observer* observer_; | 142 Observer* observer_; |
137 CategoryFactory* category_factory_; | 143 CategoryFactory* category_factory_; |
138 }; | 144 }; |
139 | 145 |
140 } // namespace ntp_snippets | 146 } // namespace ntp_snippets |
141 | 147 |
142 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ | 148 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
OLD | NEW |