Chromium Code Reviews| Index: components/ntp_snippets/category_factory.h |
| diff --git a/components/ntp_snippets/category_factory.h b/components/ntp_snippets/category_factory.h |
| index dcaec00d7320d7e5e4fc6e2223cdd497001dda04..5bbd9972ed4b0b32d70992531a5b089b0e6c6459 100644 |
| --- a/components/ntp_snippets/category_factory.h |
| +++ b/components/ntp_snippets/category_factory.h |
| @@ -6,6 +6,7 @@ |
| #define COMPONENTS_NTP_SNIPPETS_CATEGORY_FACTORY_H_ |
| #include <map> |
| +#include <string> |
| #include <vector> |
| #include "base/macros.h" |
| @@ -43,6 +44,19 @@ class CategoryFactory { |
| // |FromRemoteCategory|. |
| bool CompareCategories(const Category& left, const Category& right) const; |
| + // Creates a unique ID. The given |within_category_id| must be unique among |
| + // all suggestion IDs from this provider for the given |category|. This method |
| + // 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. |
| + std::string MakeUniqueID(Category category, |
| + const std::string& within_category_id) const; |
| + |
| + // Reverse functions for MakeUniqueID() |
| + Category GetCategoryFromUniqueID(const std::string& unique_id); |
| + std::string GetWithinCategoryIDFromUniqueID( |
| + const std::string& unique_id) const; |
|
Marc Treib
2016/09/21 19:10:16
Hm. These don't really belong in the CategoryFacto
jkrcal
2016/09/22 09:12:41
Done.
|
| + |
| private: |
| bool CategoryExists(int id); |
| void AddKnownCategory(KnownCategories known_category); |