Index: chrome/browser/android/ntp/ntp_snippets_bridge.cc |
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
index 5f9cbf85b7f411f2d3751301aee002ac1df9f7ea..5d0ff303a90cb693389641b0527a88da246b9fb2 100644 |
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
@@ -34,6 +34,7 @@ using base::android::ScopedJavaGlobalRef; |
using base::android::ScopedJavaLocalRef; |
using ntp_snippets::ContentSuggestionsCategory; |
using ntp_snippets::ContentSuggestionsCategoryStatus; |
+using ntp_snippets::KnownSuggestionsCategories; |
namespace { |
@@ -81,6 +82,7 @@ NTPSnippetsBridge::NTPSnippetsBridge(JNIEnv* env, |
HistoryServiceFactory::GetForProfile(profile, |
ServiceAccessType::EXPLICIT_ACCESS); |
content_suggestions_service_observer_.Add(content_suggestions_service_); |
+ category_factory_ = content_suggestions_service_->category_factory(); |
} |
void NTPSnippetsBridge::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
@@ -128,7 +130,8 @@ void NTPSnippetsBridge::SnippetVisited(JNIEnv* env, |
int NTPSnippetsBridge::GetCategoryStatus(JNIEnv* env, |
const JavaParamRef<jobject>& obj) { |
return static_cast<int>(content_suggestions_service_->GetCategoryStatus( |
- ContentSuggestionsCategory::ARTICLES)); |
+ category_factory_->FromKnownCategory( |
+ KnownSuggestionsCategories::ARTICLES))); |
} |
NTPSnippetsBridge::~NTPSnippetsBridge() {} |
@@ -190,7 +193,7 @@ void NTPSnippetsBridge::OnNewSuggestions() { |
void NTPSnippetsBridge::OnCategoryStatusChanged( |
ContentSuggestionsCategory category, |
ContentSuggestionsCategoryStatus new_status) { |
- if (category != ContentSuggestionsCategory::ARTICLES) |
+ if (category != KnownSuggestionsCategories::ARTICLES) |
return; |
JNIEnv* env = base::android::AttachCurrentThread(); |