Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java |
index 6e48c1ea6647b4b84b8b2b22517b6e97aef8da09..015d9208a28d30d272d12cd5d794a453a83c18ff 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java |
@@ -467,12 +467,13 @@ public class DownloadUtils { |
* Opens a file in Chrome or in another app if appropriate. |
* @param file path to the file to open. |
* @param mimeType mime type of the file. |
+ * @param downloadGuid The associated download GUID. |
* @param isOffTheRecord whether we are in an off the record context. |
* @return whether the file could successfully be opened. |
*/ |
- public static boolean openFile(File file, String mimeType, boolean isOffTheRecord) { |
+ public static boolean openFile( |
+ File file, String mimeType, String downloadGuid, boolean isOffTheRecord) { |
Context context = ContextUtils.getApplicationContext(); |
- Intent viewIntent = createViewIntentForDownloadItem(getUriForItem(file), mimeType); |
DownloadManagerService service = DownloadManagerService.getDownloadManagerService(context); |
// Check if Chrome should open the file itself. |
@@ -486,12 +487,15 @@ public class DownloadUtils { |
Intent intent = |
getMediaViewerIntentForDownloadItem(fileUri, contentUri, normalizedMimeType); |
IntentHandler.startActivityForTrustedIntent(intent); |
+ service.updateLastAccessTime(downloadGuid, isOffTheRecord); |
return true; |
} |
// Check if any apps can open the file. |
try { |
+ Intent viewIntent = createViewIntentForDownloadItem(getUriForItem(file), mimeType); |
context.startActivity(viewIntent); |
+ service.updateLastAccessTime(downloadGuid, isOffTheRecord); |
return true; |
} catch (ActivityNotFoundException e) { |
// Can't launch the Intent. |