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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java

Issue 2489143002: Use new download notification strings (Closed)
Patch Set: merge waiting and pending state Created 4 years, 1 month 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/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) {

Powered by Google App Engine
This is Rietveld 408576698