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

Unified Diff: chrome/browser/android/download/download_manager_service.h

Issue 2344483003: Ask download manager to remove a download if it is overwritten by another (Closed)
Patch Set: rename function Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/download/download_manager_service.h
diff --git a/chrome/browser/android/download/download_manager_service.h b/chrome/browser/android/download/download_manager_service.h
index 67001595245afe96f693bac452922915b2e136f5..636b14b138a9be3628f24a3c7807cbb9b2552963 100644
--- a/chrome/browser/android/download/download_manager_service.h
+++ b/chrome/browser/android/download/download_manager_service.h
@@ -11,7 +11,9 @@
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
+#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/singleton.h"
#include "chrome/browser/android/download/download_controller.h"
#include "chrome/browser/download/all_download_item_notifier.h"
#include "chrome/browser/download/download_history.h"
@@ -35,10 +37,14 @@ class DownloadManagerService : public AllDownloadItemNotifier::Observer,
content::DownloadItem* download,
DownloadController::DownloadCancelReason reason);
- DownloadManagerService(JNIEnv* env,
- jobject jobj);
+ static DownloadManagerService* GetInstance();
+
+ DownloadManagerService();
~DownloadManagerService() override;
+ // Called to Initialize this object.
+ void Init(JNIEnv* env, jobject obj);
+
// Called to resume downloading the item that has GUID equal to
// |jdownload_guid|..
void ResumeDownload(JNIEnv* env,
@@ -79,6 +85,9 @@ class DownloadManagerService : public AllDownloadItemNotifier::Observer,
const JavaParamRef<jobject>& obj,
bool is_off_the_record);
+ // Remove download items associated with |path| from downloads history.
+ void RemoveDownloadsForPath(const base::FilePath& path);
+
// DownloadHistory::Observer methods.
void OnHistoryQueryComplete() override;
@@ -95,6 +104,7 @@ class DownloadManagerService : public AllDownloadItemNotifier::Observer,
private:
// For testing.
friend class DownloadManagerServiceTest;
+ friend struct base::DefaultSingletonTraits<DownloadManagerService>;
// Helper function to start the download resumption.
void ResumeDownloadInternal(const std::string& download_guid,

Powered by Google App Engine
This is Rietveld 408576698