Index: chrome/browser/download/download_prefs.cc |
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc |
index e9e0b7681d696fe9685943a79cbe45a17994d675..44b3fb68121a7d393b1fe5e7702f043df8b6ca27 100644 |
--- a/chrome/browser/download/download_prefs.cc |
+++ b/chrome/browser/download/download_prefs.cc |
@@ -18,6 +18,7 @@ |
#include "content/browser/browser_thread.h" |
DownloadPrefs::DownloadPrefs(PrefService* prefs) : prefs_(prefs) { |
+ next_download_id_.Init(prefs::kNextDownloadId, prefs, NULL); |
prompt_for_download_.Init(prefs::kPromptForDownload, prefs, NULL); |
download_path_.Init(prefs::kDownloadDefaultDirectory, prefs, NULL); |
save_file_type_.Init(prefs::kSaveFileType, prefs, NULL); |
@@ -47,6 +48,9 @@ DownloadPrefs::~DownloadPrefs() { |
// static |
void DownloadPrefs::RegisterUserPrefs(PrefService* prefs) { |
+ prefs->RegisterIntegerPref(prefs::kNextDownloadId, |
+ 0, |
+ PrefService::UNSYNCABLE_PREF); |
prefs->RegisterBooleanPref(prefs::kPromptForDownload, |
false, |
PrefService::SYNCABLE_PREF); |
@@ -135,6 +139,12 @@ void DownloadPrefs::ResetAutoOpen() { |
SaveAutoOpenState(); |
} |
+int DownloadPrefs::GetNextId() { |
+ int next_id = *next_download_id_; |
+ prefs_->SetInteger(prefs::kNextDownloadId, next_id + 1); |
+ return next_id; |
+} |
+ |
void DownloadPrefs::SaveAutoOpenState() { |
std::string extensions; |
for (AutoOpenSet::iterator it = auto_open_.begin(); |