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

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

Issue 2943763002: Add a new group policy to disable safe browsing for files downloaded from trusted sources. (Closed)
Patch Set: Fix an XML goof Created 3 years, 5 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 09e148468e219ac4e05604bc002a3ee45750dfcb..0499d71f54ced3bac90a600b1c9d42e79b92a57f 100644
--- a/chrome/browser/download/download_prefs.h
+++ b/chrome/browser/download/download_prefs.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_
+#include <memory>
#include <set>
#include "base/files/file_path.h"
@@ -13,9 +14,11 @@
#include "components/prefs/pref_member.h"
class Profile;
+class TrustedSourcesManager;
namespace content {
class BrowserContext;
+class DownloadItem;
class DownloadManager;
}
@@ -50,6 +53,9 @@ class DownloadPrefs {
static DownloadPrefs* FromBrowserContext(
content::BrowserContext* browser_context);
+ // Identify whether the downloaded item was downloaded from a trusted source.
+ bool IsFromTrustedSource(const content::DownloadItem& item);
+
base::FilePath DownloadPath() const;
void SetDownloadPath(const base::FilePath& path);
base::FilePath SaveFilePath() const;
@@ -59,6 +65,9 @@ class DownloadPrefs {
DownloadRestriction download_restriction() const {
return static_cast<DownloadRestriction>(*download_restriction_);
}
+ bool safebrowsing_for_trusted_sources_enabled() const {
+ return *safebrowsing_for_trusted_sources_enabled_;
+ }
// 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
@@ -109,6 +118,10 @@ class DownloadPrefs {
FilePathPrefMember save_file_path_;
IntegerPrefMember save_file_type_;
IntegerPrefMember download_restriction_;
+ BooleanPrefMember safebrowsing_for_trusted_sources_enabled_;
+
+ // To identify if a download URL is from a trusted source.
+ std::unique_ptr<TrustedSourcesManager> trusted_sources_manager_;
// 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