Index: chrome/browser/download/chrome_download_manager_delegate.h |
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h |
index 2cadbe92e5b1a1d19ba4ddfb9a7caf5fcc0edfb8..af365c57a2716c28aa09342884831c2afa3544d7 100644 |
--- a/chrome/browser/download/chrome_download_manager_delegate.h |
+++ b/chrome/browser/download/chrome_download_manager_delegate.h |
@@ -9,16 +9,16 @@ |
#include "base/hash_tables.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
-#include "base/memory/weak_ptr.h" |
-#include "chrome/browser/safe_browsing/download_protection_service.h" |
+#include "chrome/browser/common/cancelable_request.h" |
#include "chrome/browser/download/download_path_reservation_tracker.h" |
+#include "chrome/browser/history/history.h" |
+#include "chrome/browser/safe_browsing/download_protection_service.h" |
#include "content/public/browser/download_danger_type.h" |
#include "content/public/browser/download_item.h" |
#include "content/public/browser/download_manager_delegate.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
-class DownloadHistory; |
class DownloadPrefs; |
class ExtensionDownloadsEventRouter; |
class Profile; |
@@ -57,7 +57,7 @@ class ChromeDownloadManagerDelegate |
void SetDownloadManager(content::DownloadManager* dm); |
- // Should be called before the call to ShouldCompleteDownload() to |
+ // Should be called before the first call to ShouldCompleteDownload() to |
// disable SafeBrowsing checks for |item|. |
static void DisableSafeBrowsing(content::DownloadItem* item); |
@@ -75,17 +75,6 @@ class ChromeDownloadManagerDelegate |
const base::Closure& complete_callback) OVERRIDE; |
virtual bool ShouldOpenDownload(content::DownloadItem* item) OVERRIDE; |
virtual bool GenerateFileHash() OVERRIDE; |
- virtual void AddItemToPersistentStore(content::DownloadItem* item) OVERRIDE; |
- virtual void UpdateItemInPersistentStore( |
- content::DownloadItem* item) OVERRIDE; |
- virtual void UpdatePathForItemInPersistentStore( |
- content::DownloadItem* item, |
- const FilePath& new_path) OVERRIDE; |
- virtual void RemoveItemFromPersistentStore( |
- content::DownloadItem* item) OVERRIDE; |
- virtual void RemoveItemsFromPersistentStoreBetween( |
- base::Time remove_begin, |
- base::Time remove_end) OVERRIDE; |
virtual void GetSaveDir(content::BrowserContext* browser_context, |
FilePath* website_save_dir, |
FilePath* download_save_dir, |
@@ -102,7 +91,6 @@ class ChromeDownloadManagerDelegate |
void ClearLastDownloadPath(); |
DownloadPrefs* download_prefs() { return download_prefs_.get(); } |
- DownloadHistory* download_history() { return download_history_.get(); } |
protected: |
// So that test classes can inherit from this for override purposes. |
@@ -163,17 +151,26 @@ class ChromeDownloadManagerDelegate |
int32 download_id, |
safe_browsing::DownloadProtectionService::DownloadCheckResult result); |
+ struct VisitedReferrerBeforeDoneParameters { |
Randy Smith (Not in Mondays)
2012/11/07 21:10:29
Oh, I wish we didn't have to do this :-{.
benjhayden
2012/11/08 18:57:03
Be careful what you wish for.
I changed this back
|
+ VisitedReferrerBeforeDoneParameters(); |
+ ~VisitedReferrerBeforeDoneParameters(); |
+ int32 download_id; |
+ content::DownloadTargetCallback callback; |
+ content::DownloadDangerType danger_type; |
+ }; |
Randy Smith (Not in Mondays)
2012/11/07 21:10:29
Style guide nit: http://google-styleguide.googleco
benjhayden
2012/11/08 18:57:03
Moot.
|
+ |
// Callback function after we check whether the referrer URL has been visited |
// before today. Determines the danger state of the download based on the file |
- // type and |visited_referrer_before|. Generates a target path for the |
- // download. Invokes |DownloadPathReservationTracker::GetReservedPath| to get |
- // a reserved path for the download. The path is then passed into |
+ // type, |found_visits|, |count|, |first_visit|. Generates a target path for |
+ // the download. Invokes |DownloadPathReservationTracker::GetReservedPath| to |
+ // get a reserved path for the download. The path is then passed into |
// OnPathReservationAvailable(). |
void CheckVisitedReferrerBeforeDone( |
- int32 download_id, |
- const content::DownloadTargetCallback& callback, |
- content::DownloadDangerType danger_type, |
- bool visited_referrer_before); |
+ const VisitedReferrerBeforeDoneParameters& params, |
+ HistoryService::Handle unused_handle, |
+ bool found_visits, |
+ int count, |
+ base::Time first_visit); |
#if defined (OS_CHROMEOS) |
// DriveDownloadObserver::SubstituteDriveDownloadPath callback. Calls |
@@ -213,9 +210,6 @@ class ChromeDownloadManagerDelegate |
content::DownloadDangerType danger_type, |
const FilePath& target_path); |
- // Callback from history system. |
- void OnItemAddedToPersistentStore(int32 download_id, int64 db_handle); |
- |
// Check policy of whether we should open this download with a web intents |
// dispatch. |
bool ShouldOpenWithWebIntents(const content::DownloadItem* item); |
@@ -234,12 +228,13 @@ class ChromeDownloadManagerDelegate |
Profile* profile_; |
int next_download_id_; |
scoped_ptr<DownloadPrefs> download_prefs_; |
- scoped_ptr<DownloadHistory> download_history_; |
// Maps from pending extension installations to DownloadItem IDs. |
typedef base::hash_map<extensions::CrxInstaller*, int> CrxInstallerMap; |
CrxInstallerMap crx_installers_; |
+ CancelableRequestConsumer history_consumer_; |
+ |
content::NotificationRegistrar registrar_; |
// On Android, GET downloads are not handled by the DownloadManager. |