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

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

Issue 1809203006: Switch to use download GUID to indentify download items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge error Created 4 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.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/ChromeDownloadDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
index 65aa770a9b850bc487b967ad4f9158059879430c..79c4a63694cce36226db50de47a948defc8e7f7d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
@@ -58,8 +58,8 @@ public class ChromeDownloadDelegate implements ContentViewDownloadDelegate {
public void onInfoBarButtonClicked(boolean confirm) {
assert mTab != null;
if (mPendingRequest == null) return;
- if (mPendingRequest.hasDownloadId()) {
- nativeDangerousDownloadValidated(mTab, mPendingRequest.getDownloadId(), confirm);
+ if (mPendingRequest.getDownloadGuid() != null) {
+ nativeDangerousDownloadValidated(mTab, mPendingRequest.getDownloadGuid(), confirm);
if (confirm) {
showDownloadStartNotification();
}
@@ -107,9 +107,10 @@ public class ChromeDownloadDelegate implements ContentViewDownloadDelegate {
@Override
public void onInfoBarDismissed() {
if (mPendingRequest != null) {
- if (mPendingRequest.hasDownloadId()) {
+ if (mPendingRequest.getDownloadGuid() != null) {
assert mTab != null;
- nativeDangerousDownloadValidated(mTab, mPendingRequest.getDownloadId(), false);
+ nativeDangerousDownloadValidated(
+ mTab, mPendingRequest.getDownloadGuid(), false);
} else if (!mPendingRequest.isGETRequest()) {
// Infobar was dismissed, discard the file if a POST download is pending.
discardFile(mPendingRequest.getFilePath());
@@ -269,15 +270,14 @@ public class ChromeDownloadDelegate implements ContentViewDownloadDelegate {
* Called when a danagerous download is about to start.
*
* @param filename File name of the download item.
- * @param downloadId ID of the download.
+ * @param downloadGuid GUID of the download.
*/
@Override
- public void onDangerousDownload(String filename, int downloadId) {
+ public void onDangerousDownload(String filename, String downloadGuid) {
DownloadInfo downloadInfo = new DownloadInfo.Builder()
.setFileName(filename)
.setDescription(filename)
- .setHasDownloadId(true)
- .setDownloadId(downloadId).build();
+ .setDownloadGuid(downloadGuid).build();
confirmDangerousDownload(downloadInfo);
}
@@ -416,7 +416,8 @@ public class ChromeDownloadDelegate implements ContentViewDownloadDelegate {
*/
private void enqueueDownloadManagerRequest(final DownloadInfo info) {
DownloadManagerService.getDownloadManagerService(
- mContext.getApplicationContext()).enqueueDownloadManagerRequest(info, true);
+ mContext.getApplicationContext()).enqueueDownloadManagerRequest(
+ new DownloadItem(true, info), true);
closeBlankTab();
}
@@ -630,7 +631,7 @@ public class ChromeDownloadDelegate implements ContentViewDownloadDelegate {
private static native String nativeGetDownloadWarningText(String filename);
private static native boolean nativeIsDownloadDangerous(String filename);
private static native void nativeDangerousDownloadValidated(
- Object tab, int downloadId, boolean accept);
+ Object tab, String downloadGuid, boolean accept);
private static native void nativeLaunchDownloadOverwriteInfoBar(ChromeDownloadDelegate delegate,
Tab tab, DownloadInfo downloadInfo, String fileName, String dirName,
String dirFullPath);
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698