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

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

Issue 2570913003: [Android NTP] Move dismissing items into the TreeNode interface. (Closed)
Patch Set: comments 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/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java
index 5ac8614dbf72c08f4eb1c7afb0d7a4ecc7acd6d5..a0190f41f7137b9deb110cbb95d81fa366ea2421 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java
@@ -24,7 +24,8 @@ import java.util.Map;
* A node in the tree containing a list of all suggestions sections. It listens to changes in the
* suggestions source and updates the corresponding sections.
*/
-public class SectionList extends InnerNode implements SuggestionsSource.Observer {
+public class SectionList
+ extends InnerNode implements SuggestionsSource.Observer, SuggestionsSection.Delegate {
private static final String TAG = "Ntp";
/** Maps suggestion categories to sections, with stable iteration ordering. */
@@ -91,7 +92,7 @@ public class SectionList extends InnerNode implements SuggestionsSource.Observer
// Create the section if needed.
if (section == null) {
- section = new SuggestionsSection(mNewTabPageManager, mOfflinePageBridge, info);
+ section = new SuggestionsSection(this, mNewTabPageManager, mOfflinePageBridge, info);
mSections.put(category, section);
addChild(section);
}
@@ -207,6 +208,7 @@ public class SectionList extends InnerNode implements SuggestionsSource.Observer
* Dismisses a section.
* @param section The section to be dismissed.
*/
+ @Override
public void dismissSection(SuggestionsSection section) {
assert SnippetsConfig.isSectionDismissalEnabled();

Powered by Google App Engine
This is Rietveld 408576698