Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java |
| index 72d428aa54dc5800a3afaa018915ce8ef7be15d6..b964159cab0b512e4c0f96c905a7ebd9c58e552a 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java |
| @@ -130,11 +130,11 @@ public void onSnippetsReceived(List<SnippetArticle> listSnippets) { |
| int newSnippetCount = listSnippets.size(); |
| Log.d(TAG, "Received %d new snippets.", newSnippetCount); |
| + loadSnippets(listSnippets); |
| + |
| // At first, there might be no snippets available, we wait until they have been fetched. |
| if (newSnippetCount == 0) return; |
| - loadSnippets(listSnippets); |
|
dgn
2016/06/13 17:27:15
I chose to reload the list of snippets to update t
|
| - |
| // We don't want to get notified of other changes. |
| mWantsSnippets = false; |
| NewTabPageUma.recordSnippetAction(NewTabPageUma.SNIPPETS_ACTION_SHOWN); |
| @@ -174,7 +174,7 @@ public NewTabPageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
| } |
| if (viewType == NewTabPageListItem.VIEW_TYPE_STATUS) { |
| - return new StatusListItem.ViewHolder(mRecyclerView, this); |
| + return new StatusListItem.ViewHolder(mRecyclerView); |
| } |
| return null; |
| @@ -217,7 +217,7 @@ private void loadSnippets(List<SnippetArticle> listSnippets) { |
| if (hasContentToShow) { |
| mNewTabPageListItems.addAll(listSnippets); |
| } else { |
| - mNewTabPageListItems.add(new StatusListItem()); |
| + mNewTabPageListItems.add(new StatusListItem(mSnippetsBridge, this)); |
| } |
| mNewTabPageListItems.add(new SpacingListItem()); |
| @@ -263,7 +263,7 @@ private void addStatusCardIfNecessary() { |
| if (mNewTabPageListItems.size() == 3 /* above-the-fold + header + spacing */) { |
| // TODO(dgn) hack until we refactor the entire class with sections, etc. |
| // (see https://crbug.com/616090) |
| - mNewTabPageListItems.add(2, new StatusListItem()); |
| + mNewTabPageListItems.add(2, new StatusListItem(mSnippetsBridge, this)); |
| // We also want to refresh the header and the bottom padding. |
| mHeaderListItem.setVisible(false); |