| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| index df9de4ac120d1195a16b50096a8357d779a05b6f..a6d0382ef7766c6723630e7a6db14de66ce97a7c 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java
|
| @@ -74,9 +74,6 @@ public class SnippetArticle {
|
| /** The tab id of the corresponding tab (only for recent tab articles). */
|
| private String mRecentTabId;
|
|
|
| - /** The offline page id (only for recent tab articles). */
|
| - private String mRecentTabOfflinePageId;
|
| -
|
| /** The offline id of the corresponding offline page, if any. */
|
| private Long mOfflinePageOfflineId;
|
|
|
| @@ -175,6 +172,16 @@ public class SnippetArticle {
|
| mDownloadAssetMimeType = mimeType;
|
| }
|
|
|
| + /**
|
| + * Marks the article suggestion as a download offline page with the given id. May only be called
|
| + * if this snippet belongs to DOWNLOADS category.
|
| + */
|
| + public void setDownloadOfflinePageData(String offlinePageId) {
|
| + assert isDownload();
|
| + mIsDownloadedAsset = false;
|
| + setOfflinePageOfflineId(Long.parseLong(offlinePageId));
|
| + }
|
| +
|
| public boolean isRecentTab() {
|
| return mCategory == KnownCategories.RECENT_TABS;
|
| }
|
| @@ -189,22 +196,13 @@ public class SnippetArticle {
|
| }
|
|
|
| /**
|
| - * @return the corresponding recent tab offline page id. May only be called if this snippet is a
|
| - * recent tab article.
|
| - */
|
| - public String getRecentTabOfflinePageId() {
|
| - assert isRecentTab();
|
| - return mRecentTabOfflinePageId;
|
| - }
|
| -
|
| - /**
|
| * Sets tab id and offline page id for recent tab articles. May only be called if this snippet
|
| * is a recent tab article.
|
| */
|
| public void setRecentTabData(String tabId, String offlinePageId) {
|
| assert isRecentTab();
|
| mRecentTabId = tabId;
|
| - mRecentTabOfflinePageId = offlinePageId;
|
| + setOfflinePageOfflineId(Long.parseLong(offlinePageId));
|
| }
|
|
|
| /** Sets offline id of the corresponding to the snippet offline page. Null to clear.*/
|
|
|