| 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 100bb308b63a19ec680997c499854388907f97c2..69ccca4556404bf62277b00a7ce2326223eb1f7f 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
|
| @@ -17,7 +17,7 @@
|
| import org.chromium.chrome.browser.ntp.NewTabPageUma;
|
| import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
|
| import org.chromium.chrome.browser.ntp.snippets.DisabledReason;
|
| -import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
|
| +import org.chromium.chrome.browser.ntp.snippets.SnippetArticleListItem;
|
| import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder;
|
| import org.chromium.chrome.browser.ntp.snippets.SnippetHeaderListItem;
|
| import org.chromium.chrome.browser.ntp.snippets.SnippetHeaderViewHolder;
|
| @@ -123,7 +123,7 @@ public NewTabPageAdapter(NewTabPageManager manager, NewTabPageLayout newTabPageL
|
| mSnippetsBridge = snippetsBridge;
|
| mStatusListItem = StatusListItem.create(snippetsBridge.getDisabledReason(), this, manager);
|
|
|
| - loadSnippets(new ArrayList<SnippetArticle>());
|
| + loadSnippets(new ArrayList<SnippetArticleListItem>());
|
| mSnippetsBridge.setObserver(this);
|
| }
|
|
|
| @@ -133,7 +133,7 @@ public NewTabPageAdapter(NewTabPageManager manager, NewTabPageLayout newTabPageL
|
| }
|
|
|
| @Override
|
| - public void onSnippetsReceived(List<SnippetArticle> listSnippets) {
|
| + public void onSnippetsReceived(List<SnippetArticleListItem> listSnippets) {
|
| if (!mWantsSnippets) return;
|
|
|
| int newSnippetCount = listSnippets.size();
|
| @@ -158,7 +158,7 @@ public void onDisabledReasonChanged(int disabledReason) {
|
| if (getItemCount() > 4 /* above-the-fold + header + card + spacing */) {
|
| // We had many items, implies that the service was previously enabled and just
|
| // transitioned. to a disabled state. We now clear it.
|
| - loadSnippets(new ArrayList<SnippetArticle>());
|
| + loadSnippets(new ArrayList<SnippetArticleListItem>());
|
| } else {
|
| mNewTabPageListItems.set(FIRST_CARD_POSITION, mStatusListItem);
|
| notifyItemRangeChanged(FIRST_CARD_POSITION, 2); // Update both the first card and the
|
| @@ -218,14 +218,14 @@ public void reloadSnippets() {
|
| SnippetsBridge.fetchSnippets();
|
| }
|
|
|
| - private void loadSnippets(List<SnippetArticle> listSnippets) {
|
| + private void loadSnippets(List<SnippetArticleListItem> listSnippets) {
|
| // Copy thumbnails over
|
| - for (SnippetArticle newSnippet : listSnippets) {
|
| + for (SnippetArticleListItem newSnippet : listSnippets) {
|
| int existingSnippetIdx = mNewTabPageListItems.indexOf(newSnippet);
|
| if (existingSnippetIdx == -1) continue;
|
|
|
| newSnippet.setThumbnailBitmap(
|
| - ((SnippetArticle) mNewTabPageListItems.get(existingSnippetIdx))
|
| + ((SnippetArticleListItem) mNewTabPageListItems.get(existingSnippetIdx))
|
| .getThumbnailBitmap());
|
| }
|
|
|
| @@ -265,7 +265,8 @@ private void dismissItem(ViewHolder itemViewHolder) {
|
| assert itemViewHolder.getItemViewType() == NewTabPageListItem.VIEW_TYPE_SNIPPET;
|
|
|
| int position = itemViewHolder.getAdapterPosition();
|
| - SnippetArticle dismissedSnippet = (SnippetArticle) mNewTabPageListItems.get(position);
|
| + SnippetArticleListItem dismissedSnippet =
|
| + (SnippetArticleListItem) mNewTabPageListItems.get(position);
|
|
|
| mSnippetsBridge.getSnippedVisited(dismissedSnippet, new Callback<Boolean>() {
|
| @Override
|
|
|