Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2814)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java

Issue 2737723002: Downloads : Last access time update for NTP, duplicate infobar and notifications (Closed)
Patch Set: Removed changes for duplicate infobar Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698