| 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 964090801fdab216a43aa3e5cab57f8353a077ac..9f3beade41a91127c377f91de148522ed367ecbd 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
|
| @@ -59,6 +59,9 @@ public class SnippetArticle implements OfflinableSuggestion {
|
| /** Whether the linked article represents an asset download. */
|
| private boolean mIsAssetDownload;
|
|
|
| + /** The GUID of the asset download (only for asset download articles). */
|
| + private String mAssetDownloadGuid;
|
| +
|
| /** The path to the asset download (only for asset download articles). */
|
| private File mAssetDownloadFile;
|
|
|
| @@ -132,6 +135,16 @@ public class SnippetArticle implements OfflinableSuggestion {
|
| }
|
|
|
| /**
|
| + * @return the GUID of the asset download. May only be called if {@link #mIsAssetDownload} is
|
| + * {@code true} (which implies that this snippet belongs to the DOWNLOADS category).
|
| + */
|
| + public String getAssetDownloadGuid() {
|
| + assert isDownload();
|
| + assert mIsAssetDownload;
|
| + return mAssetDownloadGuid;
|
| + }
|
| +
|
| + /**
|
| * @return the asset download path. May only be called if {@link #mIsAssetDownload} is
|
| * {@code true} (which implies that this snippet belongs to the DOWNLOADS category).
|
| */
|
| @@ -155,9 +168,10 @@ public class SnippetArticle implements OfflinableSuggestion {
|
| * Marks the article suggestion as an asset download with the given path and mime type. May only
|
| * be called if this snippet belongs to DOWNLOADS category.
|
| */
|
| - public void setAssetDownloadData(String filePath, String mimeType) {
|
| + public void setAssetDownloadData(String downloadGuid, String filePath, String mimeType) {
|
| assert isDownload();
|
| mIsAssetDownload = true;
|
| + mAssetDownloadGuid = downloadGuid;
|
| mAssetDownloadFile = new File(filePath);
|
| mAssetDownloadMimeType = mimeType;
|
| }
|
|
|