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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java

Issue 2379143002: use offline bolt icon for download completion notification (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 unified diff | Download patch
« no previous file with comments | « chrome/android/java/res/drawable-xxxhdpi/offline_pin.png ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.download; 5 package org.chromium.chrome.browser.download;
6 6
7 import android.app.ActivityManager; 7 import android.app.ActivityManager;
8 import android.app.DownloadManager; 8 import android.app.DownloadManager;
9 import android.app.Notification; 9 import android.app.Notification;
10 import android.app.NotificationManager; 10 import android.app.NotificationManager;
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 * @param downloadGuid GUID of the download. 328 * @param downloadGuid GUID of the download.
329 * @param fileName GUID of the download. 329 * @param fileName GUID of the download.
330 * @param systemDownloadId Download ID assigned by system DownloadManager. 330 * @param systemDownloadId Download ID assigned by system DownloadManager.
331 * @return ID of the successful download notification. Used for removing the notification when 331 * @return ID of the successful download notification. Used for removing the notification when
332 * user click on the snackbar. 332 * user click on the snackbar.
333 */ 333 */
334 public int notifyDownloadSuccessful( 334 public int notifyDownloadSuccessful(
335 String downloadGuid, String fileName, long systemDownloadId, boolean isOfflinePage) { 335 String downloadGuid, String fileName, long systemDownloadId, boolean isOfflinePage) {
336 int notificationId = getNotificationId(downloadGuid); 336 int notificationId = getNotificationId(downloadGuid);
337 NotificationCompat.Builder builder = buildNotification( 337 NotificationCompat.Builder builder = buildNotification(
338 android.R.drawable.stat_sys_download_done, fileName, 338 R.drawable.offline_pin, fileName,
339 mContext.getResources().getString(R.string.download_notification _completed)); 339 mContext.getResources().getString(R.string.download_notification _completed));
340 ComponentName component = new ComponentName( 340 ComponentName component = new ComponentName(
341 mContext.getPackageName(), DownloadBroadcastReceiver.class.getNa me()); 341 mContext.getPackageName(), DownloadBroadcastReceiver.class.getNa me());
342 Intent intent; 342 Intent intent;
343 if (isOfflinePage) { 343 if (isOfflinePage) {
344 intent = buildActionIntent(ACTION_DOWNLOAD_OPEN, notificationId, dow nloadGuid, fileName, 344 intent = buildActionIntent(ACTION_DOWNLOAD_OPEN, notificationId, dow nloadGuid, fileName,
345 isOfflinePage); 345 isOfflinePage);
346 } else { 346 } else {
347 intent = new Intent(DownloadManager.ACTION_NOTIFICATION_CLICKED); 347 intent = new Intent(DownloadManager.ACTION_NOTIFICATION_CLICKED);
348 long[] idArray = {systemDownloadId}; 348 long[] idArray = {systemDownloadId};
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 return context.getString(R.string.remaining_duration_minutes, minute s); 789 return context.getString(R.string.remaining_duration_minutes, minute s);
790 } else if (minutes > 0) { 790 } else if (minutes > 0) {
791 return context.getString(R.string.remaining_duration_one_minute); 791 return context.getString(R.string.remaining_duration_one_minute);
792 } else if (seconds == 1) { 792 } else if (seconds == 1) {
793 return context.getString(R.string.remaining_duration_one_second); 793 return context.getString(R.string.remaining_duration_one_second);
794 } else { 794 } else {
795 return context.getString(R.string.remaining_duration_seconds, second s); 795 return context.getString(R.string.remaining_duration_seconds, second s);
796 } 796 }
797 } 797 }
798 } 798 }
OLDNEW
« no previous file with comments | « chrome/android/java/res/drawable-xxxhdpi/offline_pin.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698