| 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 <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public: | 32 public: |
| 33 // JNI registration. | 33 // JNI registration. |
| 34 static bool RegisterDownloadManagerService(JNIEnv* env); | 34 static bool RegisterDownloadManagerService(JNIEnv* env); |
| 35 | 35 |
| 36 static void OnDownloadCanceled( | 36 static void OnDownloadCanceled( |
| 37 content::DownloadItem* download, | 37 content::DownloadItem* download, |
| 38 DownloadController::DownloadCancelReason reason); | 38 DownloadController::DownloadCancelReason reason); |
| 39 | 39 |
| 40 static DownloadManagerService* GetInstance(); | 40 static DownloadManagerService* GetInstance(); |
| 41 | 41 |
| 42 static base::android::ScopedJavaLocalRef<jobject> CreateJavaDownloadInfo( |
| 43 JNIEnv* env, content::DownloadItem* item); |
| 44 |
| 42 DownloadManagerService(); | 45 DownloadManagerService(); |
| 43 ~DownloadManagerService() override; | 46 ~DownloadManagerService() override; |
| 44 | 47 |
| 45 // Called to Initialize this object. | 48 // Called to Initialize this object. |
| 46 void Init(JNIEnv* env, jobject obj); | 49 void Init(JNIEnv* env, jobject obj); |
| 47 | 50 |
| 48 // Called to resume downloading the item that has GUID equal to | 51 // Called to resume downloading the item that has GUID equal to |
| 49 // |jdownload_guid|.. | 52 // |jdownload_guid|.. |
| 50 void ResumeDownload(JNIEnv* env, | 53 void ResumeDownload(JNIEnv* env, |
| 51 jobject obj, | 54 jobject obj, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void GetAllDownloads(JNIEnv* env, | 87 void GetAllDownloads(JNIEnv* env, |
| 85 const JavaParamRef<jobject>& obj, | 88 const JavaParamRef<jobject>& obj, |
| 86 bool is_off_the_record); | 89 bool is_off_the_record); |
| 87 | 90 |
| 88 // Called to check if the files associated with any downloads have been | 91 // Called to check if the files associated with any downloads have been |
| 89 // removed by an external action. | 92 // removed by an external action. |
| 90 void CheckForExternallyRemovedDownloads(JNIEnv* env, | 93 void CheckForExternallyRemovedDownloads(JNIEnv* env, |
| 91 const JavaParamRef<jobject>& obj, | 94 const JavaParamRef<jobject>& obj, |
| 92 bool is_off_the_record); | 95 bool is_off_the_record); |
| 93 | 96 |
| 94 // Remove download items associated with |path| from downloads history. | |
| 95 void RemoveDownloadsForPath(const base::FilePath& path); | |
| 96 | |
| 97 // DownloadHistory::Observer methods. | 97 // DownloadHistory::Observer methods. |
| 98 void OnHistoryQueryComplete() override; | 98 void OnHistoryQueryComplete() override; |
| 99 | 99 |
| 100 // AllDownloadItemNotifier::Observer methods. | 100 // AllDownloadItemNotifier::Observer methods. |
| 101 void OnDownloadCreated(content::DownloadManager* manager, | 101 void OnDownloadCreated(content::DownloadManager* manager, |
| 102 content::DownloadItem* item) override; | 102 content::DownloadItem* item) override; |
| 103 void OnDownloadUpdated(content::DownloadManager* manager, | 103 void OnDownloadUpdated(content::DownloadManager* manager, |
| 104 content::DownloadItem* item) override; | 104 content::DownloadItem* item) override; |
| 105 void OnDownloadRemoved(content::DownloadManager* manager, | 105 void OnDownloadRemoved(content::DownloadManager* manager, |
| 106 content::DownloadItem* item) override; | 106 content::DownloadItem* item) override; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 ResumeCallback resume_callback_for_testing_; | 171 ResumeCallback resume_callback_for_testing_; |
| 172 | 172 |
| 173 std::unique_ptr<AllDownloadItemNotifier> original_notifier_; | 173 std::unique_ptr<AllDownloadItemNotifier> original_notifier_; |
| 174 std::unique_ptr<AllDownloadItemNotifier> off_the_record_notifier_; | 174 std::unique_ptr<AllDownloadItemNotifier> off_the_record_notifier_; |
| 175 | 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(DownloadManagerService); | 176 DISALLOW_COPY_AND_ASSIGN(DownloadManagerService); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ | 179 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ |
| OLD | NEW |