Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| index f12824fbd3e08e81245f477076c9afbe92b2e50e..ea908f8d1827e625c6374597c1d099b43e39f125 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java |
| @@ -68,19 +68,23 @@ public class OfflinePageNotificationBridge { |
| * @param url URL of the page to download. |
| * @param startTime Time of the request. |
| * @param displayName Name to be displayed on notification. |
| + * @param isOfflining Whether the page is being offlined. |
| */ |
| @CalledByNative |
| public static void notifyDownloadProgress( |
| - Context context, String guid, String url, long startTime, String displayName) { |
| + Context context, String guid, String url, long startTime, String displayName, |
| + boolean isOfflining) { |
| DownloadNotifier notifier = getDownloadNotifier(context); |
| if (notifier == null) return; |
| + // TODO(qinmin): get the download percentage from native code, |
| + int percentage = isOfflining ? 0 : -1; |
|
dougarnett
2016/11/23 19:00:09
Min, I wonder if passing isOffling (or isPending (
|
| DownloadInfo downloadInfo = new DownloadInfo.Builder() |
| .setIsOfflinePage(true) |
| .setDownloadGuid(guid) |
| .setFileName(displayName) |
| .setFilePath(url) |
| - .setPercentCompleted(-1) |
| + .setPercentCompleted(percentage) |
| .setIsOffTheRecord(false) |
| .setIsResumable(true) |
| .setTimeRemainingInMillis(0) |
| @@ -146,7 +150,7 @@ public class OfflinePageNotificationBridge { |
| */ |
| @CalledByNative |
| public static void showDownloadingToast(Context context) { |
| - Toast.makeText(context, R.string.download_pending, Toast.LENGTH_SHORT).show(); |
| + Toast.makeText(context, R.string.download_started, Toast.LENGTH_SHORT).show(); |
| } |
| private static DownloadNotifier getDownloadNotifier(Context context) { |