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 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ |
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ | 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 // If the DownloadItem is not yet created, retry after a while. | 33 // If the DownloadItem is not yet created, retry after a while. |
34 void ResumeDownload(JNIEnv* env, | 34 void ResumeDownload(JNIEnv* env, |
35 jobject obj, | 35 jobject obj, |
36 uint32_t download_id, | 36 uint32_t download_id, |
37 jstring fileName); | 37 jstring fileName); |
38 | 38 |
39 // Called to cancel a download item that has ID equal to |download_id|. | 39 // Called to cancel a download item that has ID equal to |download_id|. |
40 // If the DownloadItem is not yet created, retry after a while. | 40 // If the DownloadItem is not yet created, retry after a while. |
41 void CancelDownload(JNIEnv* env, jobject obj, uint32_t download_id); | 41 void CancelDownload(JNIEnv* env, jobject obj, uint32_t download_id); |
42 | 42 |
| 43 // Called to pause a download item that has ID equal to |download_id|. |
| 44 // If the DownloadItem is not yet created, do nothing as it is already paused. |
| 45 void PauseDownload(JNIEnv* env, jobject obj, uint32_t download_id); |
| 46 |
43 // content::DownloadManager::Observer methods. | 47 // content::DownloadManager::Observer methods. |
44 void ManagerGoingDown(content::DownloadManager* manager) override; | 48 void ManagerGoingDown(content::DownloadManager* manager) override; |
45 | 49 |
46 private: | 50 private: |
47 // For testing. | 51 // For testing. |
48 friend class DownloadManagerServiceTest; | 52 friend class DownloadManagerServiceTest; |
49 | 53 |
50 // Resume downloading the given DownloadItem. | 54 // Resume downloading the given DownloadItem. |
51 void ResumeDownloadItem(content::DownloadItem* item, | 55 void ResumeDownloadItem(content::DownloadItem* item, |
52 const std::string& fileName); | 56 const std::string& fileName); |
(...skipping 21 matching lines...) Expand all Loading... |
74 | 78 |
75 // Download manager this class observes | 79 // Download manager this class observes |
76 content::DownloadManager* manager_; | 80 content::DownloadManager* manager_; |
77 | 81 |
78 ResumeCallback resume_callback_for_testing_; | 82 ResumeCallback resume_callback_for_testing_; |
79 | 83 |
80 DISALLOW_COPY_AND_ASSIGN(DownloadManagerService); | 84 DISALLOW_COPY_AND_ASSIGN(DownloadManagerService); |
81 }; | 85 }; |
82 | 86 |
83 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ | 87 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ |
OLD | NEW |