| OLD | NEW |
| 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.content.ComponentName; | 7 import android.content.ComponentName; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.ServiceConnection; | 10 import android.content.ServiceConnection; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 228 } |
| 229 | 229 |
| 230 /** | 230 /** |
| 231 * Called when a successful notification is shown. | 231 * Called when a successful notification is shown. |
| 232 * @param info Pending notification information to be handled. | 232 * @param info Pending notification information to be handled. |
| 233 * @param notificationId ID of the notification. | 233 * @param notificationId ID of the notification. |
| 234 */ | 234 */ |
| 235 @VisibleForTesting | 235 @VisibleForTesting |
| 236 void onSuccessNotificationShown( | 236 void onSuccessNotificationShown( |
| 237 final PendingNotificationInfo notificationInfo, final int notificati
onId) { | 237 final PendingNotificationInfo notificationInfo, final int notificati
onId) { |
| 238 DownloadManagerService.getDownloadManagerService( | 238 DownloadManagerService.getDownloadManagerService().onSuccessNotification
Shown( |
| 239 mApplicationContext).onSuccessNotificationShown( | 239 notificationInfo.downloadInfo, notificationInfo.canResolve, noti
ficationId, |
| 240 notificationInfo.downloadInfo, notificationInfo.canResol
ve, | 240 notificationInfo.systemDownloadId); |
| 241 notificationId, notificationInfo.systemDownloadId); | |
| 242 } | 241 } |
| 243 | 242 |
| 244 /** | 243 /** |
| 245 * Helper method to schedule download notification updates. | 244 * Helper method to schedule download notification updates. |
| 246 * @param notificationInfo Pending notification information to be handled. | 245 * @param notificationInfo Pending notification information to be handled. |
| 247 * @param autoRelease Whether or not to allow unbinding the service after pr
ocessing the action. | 246 * @param autoRelease Whether or not to allow unbinding the service after pr
ocessing the action. |
| 248 */ | 247 */ |
| 249 @VisibleForTesting | 248 @VisibleForTesting |
| 250 void updateDownloadNotification( | 249 void updateDownloadNotification( |
| 251 final PendingNotificationInfo notificationInfo, boolean autoRelease)
{ | 250 final PendingNotificationInfo notificationInfo, boolean autoRelease)
{ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 default: | 296 default: |
| 298 assert false; | 297 assert false; |
| 299 } | 298 } |
| 300 | 299 |
| 301 // Don't need to expose the notification id to ignore. Cancel will auto
matically call this | 300 // Don't need to expose the notification id to ignore. Cancel will auto
matically call this |
| 302 // method as well and pass it in. | 301 // method as well and pass it in. |
| 303 if (mBoundService != null) mBoundService.hideSummaryNotificationIfNecess
ary(-1); | 302 if (mBoundService != null) mBoundService.hideSummaryNotificationIfNecess
ary(-1); |
| 304 if (autoRelease) unbindServiceIfNeeded(); | 303 if (autoRelease) unbindServiceIfNeeded(); |
| 305 } | 304 } |
| 306 } | 305 } |
| OLD | NEW |