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

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

Issue 6973052: When the download folder does not exist, change the download folder to a user's "Downloads" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reflected Pawel's comments Created 9 years, 6 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.h
diff --git a/chrome/browser/download/download_prefs.h b/chrome/browser/download/download_prefs.h
index cd7bad44e961bc81369d67d8d1d3d9be28c9dce3..578602d314d55a6b9397060e5fa368120be447c6 100644
--- a/chrome/browser/download/download_prefs.h
+++ b/chrome/browser/download/download_prefs.h
@@ -11,6 +11,10 @@
#include "base/file_path.h"
#include "chrome/browser/prefs/pref_member.h"
+namespace download_test_util {
+class ScopedDefaultDownloadDirectory;
+}
+
class PrefService;
// Stores all download-related preferences.
@@ -48,14 +52,26 @@ class DownloadPrefs {
void ResetAutoOpen();
+ FilePath GetDefaultDownloadDirectory();
+
private:
+ friend class download_test_util::ScopedDefaultDownloadDirectory;
+
void SaveAutoOpenState();
+ // This method can be used only through ScopedDefaultDownloadDirectory.
+ void OverrideDefaultDownloadDirectory(
+ const FilePath& override_default_download_dir);
+
+ // This method can be used only through ScopedDefaultDownloadDirectory.
+ void UnOverrideDefaultDownloadDirectory();
+
PrefService* prefs_;
BooleanPrefMember prompt_for_download_;
FilePathPrefMember download_path_;
IntegerPrefMember save_file_type_;
+ FilePath override_default_download_dir_;
// Set of file extensions to open at download completion.
struct AutoOpenCompareFunctor {

Powered by Google App Engine
This is Rietveld 408576698