Chromium Code Reviews| Index: components/ntp_snippets/content_suggestions_provider.h |
| diff --git a/components/ntp_snippets/content_suggestions_provider.h b/components/ntp_snippets/content_suggestions_provider.h |
| index 995db450679bf008f38f2340dadc230ac4887f4b..6d611b4b87d25a593cbac9de6018c19eee54fdb0 100644 |
| --- a/components/ntp_snippets/content_suggestions_provider.h |
| +++ b/components/ntp_snippets/content_suggestions_provider.h |
| @@ -66,6 +66,11 @@ class ContentSuggestionsProvider { |
| // ownership of the observer and the observer must outlive this provider. |
| virtual void SetObserver(Observer* observer) = 0; |
| + // Returns the categories provided by this provider. |
| + // TODO(pke): "The value returned by this getter must not change unless |
| + // OnXxx is called on the observer." |
| + virtual std::vector<ContentSuggestionsCategory> provided_categories() = 0; |
|
Marc Treib
2016/07/28 11:41:46
GetProvidedCategories - let's use hacker_style met
Philipp Keck
2016/07/28 13:50:54
Done.
|
| + |
| // Determines the status of the given |category|, see |
| // ContentSuggestionsCategoryStatus. |
| virtual ContentSuggestionsCategoryStatus GetCategoryStatus( |
| @@ -94,13 +99,9 @@ class ContentSuggestionsProvider { |
| // have been permanently deleted, depending on the provider implementation. |
| virtual void ClearDismissedSuggestionsForDebugging() = 0; |
| - const std::vector<ContentSuggestionsCategory>& provided_categories() const { |
| - return provided_categories_; |
| - } |
| - |
| protected: |
| ContentSuggestionsProvider( |
| - const std::vector<ContentSuggestionsCategory>& provided_categories); |
| + ContentSuggestionsCategoryFactory* category_factory); |
| virtual ~ContentSuggestionsProvider(); |
| // Creates a unique ID. The given |within_category_id| must be unique among |
| @@ -108,16 +109,14 @@ class ContentSuggestionsProvider { |
| // combines it with the |category| to form an ID that is unique |
| // application-wide, because this provider is the only one that provides |
| // suggestions for that category. |
| - static std::string MakeUniqueID(ContentSuggestionsCategory category, |
| - const std::string& within_category_id); |
| + std::string MakeUniqueID(ContentSuggestionsCategory category, |
| + const std::string& within_category_id); |
| // Reverse functions for MakeUniqueID() |
| - static ContentSuggestionsCategory GetCategoryFromUniqueID( |
| - const std::string& unique_id); |
| - static std::string GetWithinCategoryIDFromUniqueID( |
| + ContentSuggestionsCategory GetCategoryFromUniqueID( |
| const std::string& unique_id); |
| + std::string GetWithinCategoryIDFromUniqueID(const std::string& unique_id); |
| - private: |
| - const std::vector<ContentSuggestionsCategory> provided_categories_; |
| + ContentSuggestionsCategoryFactory* category_factory_; |
|
Marc Treib
2016/07/28 11:41:46
Non-private members aren't allowed. You'll have to
Philipp Keck
2016/07/28 13:50:54
Done.
|
| }; |
| } // namespace ntp_snippets |