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

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

Issue 2674973003: Adding a DownloadRestrictions group policy. (Closed)
Patch Set: Some oups.... :-) Created 3 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 d0c8cfaa6a0abaf5a0643b9418285b817ebb27ad..09e148468e219ac4e05604bc002a3ee45750dfcb 100644
--- a/chrome/browser/download/download_prefs.h
+++ b/chrome/browser/download/download_prefs.h
@@ -26,6 +26,12 @@ class PrefRegistrySyncable;
// Stores all download-related preferences.
class DownloadPrefs {
public:
+ enum class DownloadRestriction {
+ NONE = 0,
+ DANGEROUS_FILES = 1,
+ POTENTIALLY_DANGEROUS_FILES = 2,
+ ALL_FILES = 3,
+ };
explicit DownloadPrefs(Profile* profile);
~DownloadPrefs();
@@ -50,6 +56,9 @@ class DownloadPrefs {
void SetSaveFilePath(const base::FilePath& path);
int save_file_type() const { return *save_file_type_; }
void SetSaveFileType(int type);
+ DownloadRestriction download_restriction() const {
+ return static_cast<DownloadRestriction>(*download_restriction_);
+ }
// Returns true if the prompt_for_download preference has been set and the
// download location is not managed (which means the user shouldn't be able
@@ -99,6 +108,7 @@ class DownloadPrefs {
FilePathPrefMember download_path_;
FilePathPrefMember save_file_path_;
IntegerPrefMember save_file_type_;
+ IntegerPrefMember download_restriction_;
// Set of file extensions to open at download completion.
struct AutoOpenCompareFunctor {
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate_unittest.cc ('k') | chrome/browser/download/download_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698