OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** Interface for classes implementing concrete implementation of UI behavior. *
/ | 7 /** Interface for classes implementing concrete implementation of UI behavior. *
/ |
8 public interface DownloadServiceDelegate { | 8 public interface DownloadServiceDelegate { |
9 /** | 9 /** |
10 * Called to cancel a download. | 10 * Called to cancel a download. |
11 * @param downloadGuid GUID of the download. | 11 * @param downloadGuid GUID of the download. |
12 * @param isOffTheRecord Whether the download is off the record. | 12 * @param isOffTheRecord Whether the download is off the record. |
13 * @param isNotificationDismissed Whether cancel is caused by dismissing the
notification. | |
14 */ | 13 */ |
15 void cancelDownload(String downloadGuid, boolean isOffTheRecord, | 14 void cancelDownload(String downloadGuid, boolean isOffTheRecord); |
16 boolean isNotificationDismissed); | |
17 | 15 |
18 /** | 16 /** |
19 * Called to pause a download. | 17 * Called to pause a download. |
20 * @param downloadGuid GUID of the download. | 18 * @param downloadGuid GUID of the download. |
21 * @param isOffTheRecord Whether the download is off the record. | 19 * @param isOffTheRecord Whether the download is off the record. |
22 */ | 20 */ |
23 void pauseDownload(String downloadGuid, boolean isOffTheRecord); | 21 void pauseDownload(String downloadGuid, boolean isOffTheRecord); |
24 | 22 |
25 /** | 23 /** |
26 * Called to resume a paused download. | 24 * Called to resume a paused download. |
27 * @param item Download item to resume. | 25 * @param item Download item to resume. |
28 * @param hasUserGesture Whether the resumption is triggered by user gesture
. | 26 * @param hasUserGesture Whether the resumption is triggered by user gesture
. |
29 * TODO(fgorski): Update the interface to not require download item. | 27 * TODO(fgorski): Update the interface to not require download item. |
30 */ | 28 */ |
31 void resumeDownload(DownloadItem item, boolean hasUserGesture); | 29 void resumeDownload(DownloadItem item, boolean hasUserGesture); |
32 | 30 |
33 /** Called to destroy the delegate, in case it needs to be destroyed. */ | 31 /** Called to destroy the delegate, in case it needs to be destroyed. */ |
34 void destroyServiceDelegate(); | 32 void destroyServiceDelegate(); |
35 } | 33 } |
OLD | NEW |