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

Unified Diff: chrome/browser/android/ntp/ntp_snippets_bridge.cc

Issue 2244793002: Remove deleted offline page suggestions from opened NTPs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: 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 ad10f01d7d773fa56fa5edea71ed159b7e5ead91..97b3e7c151d64fabfe9c6f7d90b75b8fb35586a9 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -228,6 +228,18 @@ void NTPSnippetsBridge::OnCategoryStatusChanged(Category category,
static_cast<int>(new_status));
}
+void NTPSnippetsBridge::OnSuggestionInvalidated(
+ Category category,
+ const std::string& suggestion_id) {
+ if (observer_.is_null())
+ return;
+
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_SnippetsBridge_onSuggestionInvalidated(
+ env, observer_.obj(), static_cast<int>(category.id()),
+ ConvertUTF8ToJavaString(env, suggestion_id).obj());
+}
+
void NTPSnippetsBridge::ContentSuggestionsServiceShutdown() {
observer_.Reset();
content_suggestions_service_observer_.Remove(content_suggestions_service_);

Powered by Google App Engine
This is Rietveld 408576698