diff options
Diffstat (limited to 'chrome/browser/download/chrome_download_manager_delegate.cc')
-rw-r--r-- | chrome/browser/download/chrome_download_manager_delegate.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc index 4c3cd71..73856ba 100644 --- a/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/chrome/browser/download/chrome_download_manager_delegate.cc @@ -43,6 +43,7 @@ using content::BrowserThread; using content::DownloadFile; +using content::DownloadId; using content::DownloadItem; using content::DownloadManager; using content::WebContents; @@ -66,6 +67,7 @@ struct SafeBrowsingState : public DownloadItem::ExternalData { ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile) : profile_(profile), + next_download_id_(0), download_prefs_(new DownloadPrefs(profile->GetPrefs())) { } @@ -94,6 +96,14 @@ void ChromeDownloadManagerDelegate::Shutdown() { download_prefs_.reset(); } +DownloadId ChromeDownloadManagerDelegate::GetNextId() { + if (!profile_->IsOffTheRecord()) + return DownloadId(this, next_download_id_++); + + return profile_->GetOriginalProfile()->GetDownloadManager()->delegate()-> + GetNextId(); +} + bool ChromeDownloadManagerDelegate::ShouldStartDownload(int32 download_id) { // We create a download item and store it in our download map, and inform the // history system of a new download. Since this method can be called while the |