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

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: @r202870 Created 7 years, 7 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_target_determiner.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 cc1caaf4a4914504015c88dd5ff8c4326c936482..50bf9599d8b78f9a324a52b4e5afbdf040d11c6b 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
@@ -107,6 +108,10 @@ void DownloadPrefs::RegisterUserPrefs(
prefs::kDownloadDefaultDirectory,
default_download_path,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterFilePathPref(
+ prefs::kSaveFileDefaultDirectory,
+ default_download_path,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if defined(OS_CHROMEOS)
// Ensure that the download directory specified in the preferences exists.
@@ -144,6 +149,23 @@ base::FilePath DownloadPrefs::DownloadPath() const {
return *download_path_;
}
+void DownloadPrefs::SetDownloadPath(const base::FilePath& path) {
+ download_path_.SetValue(path);
+ SetSaveFilePath(path);
+}
+
+base::FilePath DownloadPrefs::SaveFilePath() const {
+ return *save_file_path_;
+}
+
+void DownloadPrefs::SetSaveFilePath(const base::FilePath& path) {
+ 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.
« no previous file with comments | « chrome/browser/download/download_prefs.h ('k') | chrome/browser/download/download_target_determiner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698