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

Unified Diff: components/ntp_snippets/category.h

Issue 2395273003: [NTP Snippets] Persist remote categories in prefs (Closed)
Patch Set: Created 4 years, 2 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
Index: components/ntp_snippets/category.h
diff --git a/components/ntp_snippets/category.h b/components/ntp_snippets/category.h
index ba85483eb34e13fe61e55c42739a7429cd8df012..0220cb54e97c51cf5e28738c0aa06f00af4a5252 100644
--- a/components/ntp_snippets/category.h
+++ b/components/ntp_snippets/category.h
@@ -16,6 +16,8 @@ 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: These are persisted, so don't reorder or remove values, and insert new
+// values only in the appropriate places marked below.
// 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 {
@@ -33,6 +35,7 @@ enum class KnownCategories {
// Pages recently browsed to on other devices.
FOREIGN_TABS,
+ // INSERT NEW LOCAL CATEGORIES HERE!
// Follows the last local category.
LOCAL_CATEGORIES_COUNT,
@@ -42,6 +45,7 @@ enum class KnownCategories {
// Articles for you.
ARTICLES,
+ // INSERT NEW REMOTE CATEGORIES HERE!
};
// A category groups ContentSuggestions which belong together. Use the
@@ -55,8 +59,6 @@ class Category {
// Returns a non-negative identifier that is unique for the category and can
// be converted back to a Category instance using
// |CategoryFactory::FromIDValue(id)|.
- // Note that these IDs are not necessarily stable across multiple runs of
- // the application, so they should not be persisted.
int id() const { return id_; }
// Returns whether this category matches the given |known_category|.
« no previous file with comments | « no previous file | components/ntp_snippets/pref_names.h » ('j') | components/ntp_snippets/remote/ntp_snippets_service_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698