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

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

Issue 12662032: Merge SavePackageFilePicker{,ChromeOS} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r197032 Created 7 years, 8 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
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.

Powered by Google App Engine
This is Rietveld 408576698