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

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

Issue 2794353003: Hide the download summary on file open (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java » ('j') | 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.DownloadManager; 7 import android.app.DownloadManager;
8 import android.content.BroadcastReceiver; 8 import android.content.BroadcastReceiver;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 27 matching lines...) Expand all
38 break; 38 break;
39 } 39 }
40 } 40 }
41 41
42 /** 42 /**
43 * Called to open a particular download item. Falls back to opening Downloa d Home. 43 * Called to open a particular download item. Falls back to opening Downloa d Home.
44 * @param context Context of the receiver. 44 * @param context Context of the receiver.
45 * @param intent Intent from the android DownloadManager. 45 * @param intent Intent from the android DownloadManager.
46 */ 46 */
47 private void openDownload(final Context context, Intent intent) { 47 private void openDownload(final Context context, Intent intent) {
48 DownloadNotificationService.hideDanglingSummaryNotification(context);
49
48 long ids[] = 50 long ids[] =
49 intent.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLIC K_DOWNLOAD_IDS); 51 intent.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLIC K_DOWNLOAD_IDS);
50 if (ids == null || ids.length == 0) { 52 if (ids == null || ids.length == 0) {
51 DownloadManagerService.openDownloadsPage(context); 53 DownloadManagerService.openDownloadsPage(context);
52 return; 54 return;
53 } 55 }
54 56
55 long id = ids[0]; 57 long id = ids[0];
56 Uri uri = DownloadManagerDelegate.getContentUriFromDownloadManager(conte xt, id); 58 Uri uri = DownloadManagerDelegate.getContentUriFromDownloadManager(conte xt, id);
57 if (uri == null) { 59 if (uri == null) {
(...skipping 14 matching lines...) Expand all
72 * to start the browser process asynchronously, and resume or cancel the dow nload afterwards. 74 * to start the browser process asynchronously, and resume or cancel the dow nload afterwards.
73 * @param context Context of the receiver. 75 * @param context Context of the receiver.
74 * @param intent Intent retrieved from the notification. 76 * @param intent Intent retrieved from the notification.
75 */ 77 */
76 private void performDownloadOperation(final Context context, Intent intent) { 78 private void performDownloadOperation(final Context context, Intent intent) {
77 if (DownloadNotificationService.isDownloadOperationIntent(intent)) { 79 if (DownloadNotificationService.isDownloadOperationIntent(intent)) {
78 DownloadNotificationService.startDownloadNotificationService(context , intent); 80 DownloadNotificationService.startDownloadNotificationService(context , intent);
79 } 81 }
80 } 82 }
81 } 83 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698