Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: components/ntp_snippets/category.h

Issue 2337103003: [NTP Snippets] Metrics: switch over known categories (Closed)
Patch Set: no static set Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/category.cc » ('j') | components/ntp_snippets/category.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/category.h
diff --git a/components/ntp_snippets/category.h b/components/ntp_snippets/category.h
index 524986fb3b8e5af8b93a02bc87cf341d80d80a00..49b50d0e15791ee9921e520fb819c9e93f25ff42 100644
--- a/components/ntp_snippets/category.h
+++ b/components/ntp_snippets/category.h
@@ -16,6 +16,7 @@ class CategoryFactory;
// locally on the device. Categories provided by the server (IDs strictly larger
// than REMOTE_CATEGORIES_OFFSET) only need to be hard-coded here if they need
// to be recognized by the client implementation.
+// NOTE: If you add an entry here, also add it to |IsAnyKnownCategory|.
// On Android builds, a Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ntp.snippets
enum class KnownCategories {
@@ -55,8 +56,12 @@ class Category {
// the application, so they should not be persisted.
int id() const { return id_; }
+ // Returns whether this category matches the given |known_category|.
bool IsKnownCategory(KnownCategories known_category) const;
+ // Returns whether this category is any of the known categories.
jkrcal 2016/09/13 16:08:05 Without looking in the implementation, I would not
Marc Treib 2016/09/13 16:28:50 Added, except for the "except..." part. It should
jkrcal 2016/09/13 17:22:28 Agreed, thanks.
+ bool IsAnyKnownCategory() const;
+
private:
friend class CategoryFactory;
« no previous file with comments | « no previous file | components/ntp_snippets/category.cc » ('j') | components/ntp_snippets/category.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698