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

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

Issue 2568033005: [NTP::SectionOrder] Replace CategoryFactory with a category ranker. (Closed)
Patch Set: download provider tests. 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 a0cd45ffad9ae9c018dcce10e4b590cabd2975d1..9cf8f9faed5f260e3f20e6d30b7a5f5aac7ce361 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"
@@ -216,10 +217,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();
}
@@ -231,9 +230,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;
@@ -254,9 +251,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(

Powered by Google App Engine
This is Rietveld 408576698