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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2581163004: [NTP::SectionOrder] Propagate new order through ContentSuggestionsService. (Closed)
Patch Set: Created 4 years 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/content_suggestions_service.h
diff --git a/components/ntp_snippets/content_suggestions_service.h b/components/ntp_snippets/content_suggestions_service.h
index 8ad6b60afc2150c8a214d113fbc8a3f95efdc89f..c7dfbe5333c9165fb43dea82133d6a8399d58a57 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -100,9 +100,10 @@ class ContentSuggestionsService : public KeyedService,
State state() { return state_; }
- // Gets all categories for which a provider is registered. The categories
- // may or may not be available, see |GetCategoryStatus()|.
- const std::vector<Category>& GetCategories() const { return categories_; }
+ // Gets all categories for which a provider is registered. The categories may
+ // or may not be available, see |GetCategoryStatus()|. The order is obtained
+ // from |category_ranker_| immediately.
tschumann 2016/12/19 09:06:38 IMO, this comment is exposing too many implementat
vitaliii 2016/12/19 11:31:39 Done.
+ const std::vector<Category>& GetCategories();
// Gets the status of a category.
CategoryStatus GetCategoryStatus(Category category) const;
@@ -285,8 +286,9 @@ class ContentSuggestionsService : public KeyedService,
dismissed_providers_by_category_;
// All current suggestion categories, in an order determined by the
- // |category_factory_|. This vector contains exactly the same categories as
- // |providers_by_category_|.
+ // |category_ranker_|. The order here may be stale, i.e. changes in the ranker
tschumann 2016/12/19 09:06:38 nit: let's phrase this a bit clearer: The order in
vitaliii 2016/12/19 11:31:39 Done.
+ // are not immediately propagated here (use SortCategories() to refresh). This
+ // vector contains exactly the same categories as |providers_by_category_|.
std::vector<Category> categories_;
// All current suggestions grouped by category. This contains an entry for

Powered by Google App Engine
This is Rietveld 408576698