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

Unified Diff: chrome/browser/download/download_prefs.cc

Issue 7192016: chrome.experimental.downloads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merged db_handle, id; onCreated, onErased Created 9 years, 5 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
« no previous file with comments | « chrome/browser/download/download_prefs.h ('k') | chrome/browser/download/download_query.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/browser/download/download_prefs.h ('k') | chrome/browser/download/download_query.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698