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

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

Issue 2243423002: [Downloads] Add Incognito support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/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 eca01a865ad6944822974e6d2c80bcdec85590c3..49bf8062b29b7bd3a4490441a4debbe0828d808c 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
@@ -298,11 +298,6 @@ public class DownloadManagerService extends BroadcastReceiver implements
DownloadItem downloadItem = new DownloadItem(false, downloadInfo);
updateDownloadProgress(downloadItem, status);
scheduleUpdateIfNeeded();
-
- if (!mHistoryAdapters.isEmpty()) {
- nativeGetDownloadInfoFor(getNativeDownloadManagerService(), downloadItem.getId(),
- downloadItem.getDownloadInfo().isOffTheRecord());
- }
}
@Override
@@ -1480,9 +1475,10 @@ public class DownloadManagerService extends BroadcastReceiver implements
* {@link #onDownloadInfoAdded(String, String, String, String, long, long)}.
*
* This call will be delayed if the native side has not yet been initialized.
+ * @param isOffTheRecord Whether or not to get downloads for the off the record profile.
*/
- public void getAllDownloads() {
- nativeGetAllDownloads(getNativeDownloadManagerService());
+ public void getAllDownloads(boolean isOffTheRecord) {
+ nativeGetAllDownloads(getNativeDownloadManagerService(), isOffTheRecord);
}
@CalledByNative
@@ -1498,26 +1494,26 @@ public class DownloadManagerService extends BroadcastReceiver implements
}
@CalledByNative
- private void onAllDownloadsRetrieved(final List<DownloadItem> list) {
+ private void onAllDownloadsRetrieved(final List<DownloadItem> list, boolean isOffTheRecord) {
for (DownloadHistoryAdapter adapter : mHistoryAdapters) {
- adapter.onAllDownloadsRetrieved(list);
+ adapter.onAllDownloadsRetrieved(list, isOffTheRecord);
}
}
@CalledByNative
private void onDownloadItemUpdated(String guid, String displayName, String filepath, String url,
- String mimeType, long startTimestamp, long totalBytes) {
+ String mimeType, long startTimestamp, long totalBytes, boolean isOffTheRecord) {
DownloadItem item = createDownloadItem(
guid, displayName, filepath, url, mimeType, startTimestamp, totalBytes);
for (DownloadHistoryAdapter adapter : mHistoryAdapters) {
- adapter.onDownloadItemUpdated(item);
+ adapter.onDownloadItemUpdated(item, isOffTheRecord);
}
}
@CalledByNative
- private void onDownloadItemRemoved(String guid) {
+ private void onDownloadItemRemoved(String guid, boolean isOffTheRecord) {
for (DownloadHistoryAdapter adapter : mHistoryAdapters) {
- adapter.onDownloadItemRemoved(guid);
+ adapter.onDownloadItemRemoved(guid, isOffTheRecord);
}
}
@@ -1610,7 +1606,6 @@ public class DownloadManagerService extends BroadcastReceiver implements
boolean isOffTheRecord);
private native void nativeRemoveDownload(long nativeDownloadManagerService, String downloadGuid,
boolean isOffTheRecord);
- private native void nativeGetAllDownloads(long nativeDownloadManagerService);
- private native void nativeGetDownloadInfoFor(
- long nativeDownloadManagerService, String downloadGuid, boolean isOffTheRecord);
+ private native void nativeGetAllDownloads(
+ long nativeDownloadManagerService, boolean isOffTheRecord);
}

Powered by Google App Engine
This is Rietveld 408576698