Index: chrome/browser/download/download_prefs.cc |
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc |
index dd72aa5baacc3d4759d7477de649f3fef55c2e1e..51d82b8e8db4196c3a852f3ffade72a87f53d844 100644 |
--- a/chrome/browser/download/download_prefs.cc |
+++ b/chrome/browser/download/download_prefs.cc |
@@ -56,6 +56,7 @@ DownloadPrefs::DownloadPrefs(Profile* profile) : profile_(profile) { |
prompt_for_download_.Init(prefs::kPromptForDownload, prefs); |
download_path_.Init(prefs::kDownloadDefaultDirectory, prefs); |
+ save_file_path_.Init(prefs::kSaveFileDefaultDirectory, prefs); |
save_file_type_.Init(prefs::kSaveFileType, prefs); |
// We store any file extension that should be opened automatically at |
@@ -101,6 +102,9 @@ void DownloadPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
registry->RegisterFilePathPref(prefs::kDownloadDefaultDirectory, |
default_download_path, |
PrefRegistrySyncable::UNSYNCABLE_PREF); |
+ registry->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory, |
+ default_download_path, |
+ PrefRegistrySyncable::UNSYNCABLE_PREF); |
#if defined(OS_CHROMEOS) |
// Ensure that the download directory specified in the preferences exists. |
@@ -138,6 +142,20 @@ base::FilePath DownloadPrefs::DownloadPath() const { |
return *download_path_; |
} |
+base::FilePath DownloadPrefs::SaveFilePath() const { |
+ return *save_file_path_; |
+} |
+ |
+void DownloadPrefs::SetSaveFilePath(const base::FilePath& path) { |
+ if (path == SaveFilePath()) |
+ return; |
+ save_file_path_.SetValue(path); |
+} |
+ |
+void DownloadPrefs::SetSaveFileType(int type) { |
+ save_file_type_.SetValue(type); |
+} |
+ |
bool DownloadPrefs::PromptForDownload() const { |
// If the DownloadDirectory policy is set, then |prompt_for_download_| should |
// always be false. |