Chromium Code Reviews| 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 b989159158052b5abf18049dd18069fc7d1783b1..507b399f903cf16d4d6d8e52d2bd5cc7b093ac45 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 |
| @@ -480,12 +480,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. |
| @@ -499,11 +500,13 @@ public class DownloadUtils { |
| Intent intent = |
| getMediaViewerIntentForDownloadItem(fileUri, contentUri, normalizedMimeType); |
| IntentHandler.startActivityForTrustedIntent(intent); |
| + service.updateLastAccessTime(downloadGuid, isOffTheRecord); |
|
dgn
2017/03/07 13:26:51
Incognito downloads are still visible in the downl
shaktisahu
2017/03/08 02:49:17
It seems like incognito downloads are not visible
dgn
2017/03/08 11:02:08
Ah you're right, the downloaded file is only visib
|
| return true; |
| } |
| // Check if any apps can open the file. |
| try { |
| + Intent viewIntent = createViewIntentForDownloadItem(getUriForItem(file), mimeType); |
| context.startActivity(viewIntent); |
| return true; |
| } catch (ActivityNotFoundException e) { |