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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java

Issue 2244793002: Remove deleted offline page suggestions from opened NTPs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust MockContentSuggestionsProvider 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/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
index 6fea61f11cbd63d33edad7f9d79920ffaf99f54d..5e763bdc6546acb604662d33f24a0dcca0c57393 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
@@ -57,10 +57,19 @@ public class SuggestionsSection implements ItemGroup {
return Collections.unmodifiableList(items);
}
- public void dismissSuggestion(SnippetArticle suggestion) {
+ public void removeSuggestion(SnippetArticle suggestion) {
mSuggestions.remove(suggestion);
}
+ public void removeSuggestionById(String suggestionId) {
+ for (SnippetArticle suggestion : mSuggestions) {
+ if (suggestion.mId.equals(suggestionId)) {
+ removeSuggestion(suggestion);
+ return;
+ }
+ }
+ }
+
public boolean hasSuggestions() {
return !mSuggestions.isEmpty();
}

Powered by Google App Engine
This is Rietveld 408576698