| 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 f237cfb9d739240a192c728abcd1e127d1a2d0d7..cac3245b80a694fdebec4049f3515cfd3a0dca5d 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
|
| @@ -20,7 +20,6 @@
|
| import org.chromium.chrome.browser.offlinepages.OfflinePageItem;
|
|
|
| import java.util.ArrayList;
|
| -import java.util.Arrays;
|
| import java.util.Iterator;
|
| import java.util.List;
|
|
|
| @@ -41,35 +40,21 @@
|
| private final ActionItem mMoreButton;
|
| private final ProgressItem mProgressIndicator;
|
|
|
| - private final List<TreeNode> mChildren;
|
| -
|
| private boolean mIsNtpDestroyed;
|
|
|
| - public SuggestionsSection(NodeParent parent, NewTabPageManager manager,
|
| - OfflinePageBridge offlinePageBridge, SuggestionsCategoryInfo info) {
|
| - super(parent);
|
| + public SuggestionsSection(NewTabPageManager manager, OfflinePageBridge offlinePageBridge,
|
| + SuggestionsCategoryInfo info) {
|
| mCategoryInfo = info;
|
| mOfflinePageBridge = offlinePageBridge;
|
|
|
| mHeader = new SectionHeader(info.getTitle());
|
| - mSuggestionsList = new SuggestionsList(this, info);
|
| - mStatus = StatusItem.createNoSuggestionsItem(this);
|
| + mSuggestionsList = new SuggestionsList(info);
|
| + mStatus = StatusItem.createNoSuggestionsItem(info);
|
| mMoreButton = new ActionItem(this);
|
| - mProgressIndicator = new ProgressItem(this);
|
| -
|
| - mChildren = Arrays.asList(
|
| - mHeader,
|
| - mSuggestionsList,
|
| - mStatus,
|
| - mMoreButton,
|
| - mProgressIndicator);
|
| + mProgressIndicator = new ProgressItem();
|
| + addChildren(mHeader, mSuggestionsList, mStatus, mMoreButton, mProgressIndicator);
|
|
|
| setupOfflinePageBridgeObserver(manager);
|
| - }
|
| -
|
| - @Override
|
| - public void init() {
|
| - super.init();
|
| refreshChildrenVisibility();
|
| }
|
|
|
| @@ -77,8 +62,7 @@ public void init() {
|
| private final List<SnippetArticle> mSuggestions = new ArrayList<>();
|
| private final SuggestionsCategoryInfo mCategoryInfo;
|
|
|
| - public SuggestionsList(NodeParent parent, SuggestionsCategoryInfo categoryInfo) {
|
| - super(parent);
|
| + public SuggestionsList(SuggestionsCategoryInfo categoryInfo) {
|
| mCategoryInfo = categoryInfo;
|
| }
|
|
|
| @@ -140,11 +124,6 @@ public void addAll(List<SnippetArticle> suggestions) {
|
| }
|
| }
|
|
|
| - @Override
|
| - protected List<TreeNode> getChildren() {
|
| - return mChildren;
|
| - }
|
| -
|
| private void setupOfflinePageBridgeObserver(NewTabPageManager manager) {
|
| final OfflinePageBridge.OfflinePageModelObserver observer =
|
| new OfflinePageBridge.OfflinePageModelObserver() {
|
|
|