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

Unified Diff: chrome/browser/ui/webui/snippets_internals_message_handler.cc

Issue 2568033005: [NTP::SectionOrder] Replace CategoryFactory with a category ranker. (Closed)
Patch Set: rebase. 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: chrome/browser/ui/webui/snippets_internals_message_handler.cc
diff --git a/chrome/browser/ui/webui/snippets_internals_message_handler.cc b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
index c32b36c4355fb5317082bdb2a46a42dcebaacfdd..4b78785ecf15c08b83b7a2af7511bd98ed9d5584 100644
--- a/chrome/browser/ui/webui/snippets_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
@@ -24,6 +24,7 @@
#include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_features.h"
+#include "components/ntp_snippets/category.h"
#include "components/ntp_snippets/category_info.h"
#include "components/ntp_snippets/features.h"
#include "components/ntp_snippets/pref_names.h"
@@ -206,10 +207,8 @@ void SnippetsInternalsMessageHandler::HandleClearCachedSuggestions(
if (!args->GetInteger(0, &category_id))
return;
- Category category =
- content_suggestions_service_->category_factory()->FromIDValue(
- category_id);
- content_suggestions_service_->ClearCachedSuggestions(category);
+ content_suggestions_service_->ClearCachedSuggestions(
+ Category::FromIDValue(category_id));
SendContentSuggestions();
}
@@ -221,9 +220,7 @@ void SnippetsInternalsMessageHandler::HandleClearDismissedSuggestions(
if (!args->GetInteger(0, &category_id))
return;
- Category category =
- content_suggestions_service_->category_factory()->FromIDValue(
- category_id);
+ Category category = Category::FromIDValue(category_id);
content_suggestions_service_->ClearDismissedSuggestionsForDebugging(category);
SendContentSuggestions();
dismissed_state_[category] = DismissedState::LOADING;
@@ -244,9 +241,7 @@ void SnippetsInternalsMessageHandler::HandleToggleDismissedSuggestions(
if (!args->GetBoolean(1, &dismissed_visible))
return;
- Category category =
- content_suggestions_service_->category_factory()->FromIDValue(
- category_id);
+ Category category = Category::FromIDValue(category_id);
if (dismissed_visible) {
dismissed_state_[category] = DismissedState::LOADING;
content_suggestions_service_->GetDismissedSuggestionsForDebugging(
« no previous file with comments | « chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc ('k') | components/ntp_snippets/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698