diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 00:35:42 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 00:35:42 +0000 |
commit | 98e814064fa88ec31318ce94d8f20c9fba0e92ff (patch) | |
tree | a00e0dbcf23ea0d8d797e360ea422bea346f9b00 /chrome/browser/download/chrome_download_manager_delegate.cc | |
parent | f9fac85d18493f8b83152d11652bbf4a24f02338 (diff) | |
download | chromium_src-98e814064fa88ec31318ce94d8f20c9fba0e92ff.zip chromium_src-98e814064fa88ec31318ce94d8f20c9fba0e92ff.tar.gz chromium_src-98e814064fa88ec31318ce94d8f20c9fba0e92ff.tar.bz2 |
Get rid of DownloadIdFactory and instead get the next id from DownloadManagerDelegate. I've also moved DownloadId to the public directory and into the content namespace.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9169036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119310 0039d316-1c4b-4281-b951-d872f2087c98
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 |