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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java

Issue 2437243002: Fix an issue that opening a download with remapped MIME type will launch an intent (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/ui/BackendProvider.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
index 8a6c207784fa9ae4add20b26bfe481101b279138..a9a9670c2cf584c06bf5a273733e6da1037c7adc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
@@ -1149,12 +1149,14 @@ public class DownloadManagerService extends BroadcastReceiver implements
* Checks whether the download can be opened by the browser.
* @param downloadGuid GUID of the download.
* @param isOffTheRecord Whether the download is off the record.
+ * @param mimeType MIME type of the file.
* @return Whether the download is openable by the browser.
*/
@Override
- public boolean isDownloadOpenableInBrowser(String downloadGuid, boolean isOffTheRecord) {
- return nativeIsDownloadOpenableInBrowser(
- getNativeDownloadManagerService(), downloadGuid, isOffTheRecord);
+ public boolean isDownloadOpenableInBrowser(
+ String downloadGuid, boolean isOffTheRecord, String mimeType) {
+ // TODO(qinmin): for audio and video, check if the codec is supported by Chrome.
+ return isSupportedMimeType(mimeType);
}
/**
@@ -1658,8 +1660,6 @@ public class DownloadManagerService extends BroadcastReceiver implements
boolean isOffTheRecord);
private native void nativeRemoveDownload(long nativeDownloadManagerService, String downloadGuid,
boolean isOffTheRecord);
- private native boolean nativeIsDownloadOpenableInBrowser(
- long nativeDownloadManagerService, String downloadGuid, boolean isOffTheRecord);
private native void nativeGetAllDownloads(
long nativeDownloadManagerService, boolean isOffTheRecord);
private native void nativeCheckForExternallyRemovedDownloads(
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/ui/BackendProvider.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698