Chromium Code Reviews| 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 // not currently AVAILABLE, because open UIs may still be showing the | 74 // not currently AVAILABLE, because open UIs may still be showing the |
| 75 // suggestion that is to be removed. This event may also be fired for | 75 // suggestion that is to be removed. This event may also be fired for |
| 76 // |suggestion_id|s that never existed and should be ignored in that case. | 76 // |suggestion_id|s that never existed and should be ignored in that case. |
| 77 virtual void OnSuggestionInvalidated(ContentSuggestionsProvider* provider, | 77 virtual void OnSuggestionInvalidated(ContentSuggestionsProvider* provider, |
| 78 Category category, | 78 Category category, |
| 79 const std::string& suggestion_id) = 0; | 79 const std::string& suggestion_id) = 0; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 virtual ~ContentSuggestionsProvider(); | 82 virtual ~ContentSuggestionsProvider(); |
| 83 | 83 |
| 84 // Returns the categories provided by this provider. | |
| 85 // When the set of provided categories changes, the Observer is notified | |
| 86 // through |OnNewSuggestions| or |OnCategoryStatusChanged| for added | |
| 87 // categories, and through |OnCategoryStatusChanged| with parameter | |
| 88 // NOT_PROVIDED for removed categories. | |
| 89 virtual std::vector<Category> GetProvidedCategories() = 0; | |
|
Philipp Keck
2016/08/19 14:14:13
Please search your new code for "GetProvidedCatego
vitaliii
2016/08/19 16:14:14
Done.
| |
| 90 | |
| 91 // Determines the status of the given |category|, see CategoryStatus. | 84 // Determines the status of the given |category|, see CategoryStatus. |
| 92 virtual CategoryStatus GetCategoryStatus(Category category) = 0; | 85 virtual CategoryStatus GetCategoryStatus(Category category) = 0; |
| 93 | 86 |
| 94 // Returns the meta information for the given |category|. | 87 // Returns the meta information for the given |category|. |
| 95 virtual CategoryInfo GetCategoryInfo(Category category) = 0; | 88 virtual CategoryInfo GetCategoryInfo(Category category) = 0; |
| 96 | 89 |
| 97 // 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 |
| 98 // a once-dismissed suggestion is never delivered again (through the | 91 // a once-dismissed suggestion is never delivered again (through the |
| 99 // Observer). The provider must not call Observer::OnSuggestionsChanged if the | 92 // Observer). The provider must not call Observer::OnSuggestionsChanged if the |
| 100 // removal of the dismissed suggestion is the only change. | 93 // removal of the dismissed suggestion is the only change. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 CategoryFactory* category_factory() const { return category_factory_; } | 140 CategoryFactory* category_factory() const { return category_factory_; } |
| 148 | 141 |
| 149 private: | 142 private: |
| 150 Observer* observer_; | 143 Observer* observer_; |
| 151 CategoryFactory* category_factory_; | 144 CategoryFactory* category_factory_; |
| 152 }; | 145 }; |
| 153 | 146 |
| 154 } // namespace ntp_snippets | 147 } // namespace ntp_snippets |
| 155 | 148 |
| 156 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ | 149 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
| OLD | NEW |