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

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

Issue 1982723002: Use FileTypePolicies for download danger classifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_policies
Patch Set: Fix bad rebase Created 4 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
Index: chrome/browser/download/download_prefs.cc
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 01669d415f9c000fe0d6232cb3de8383012b1684..05039fe5c5eb181f30070fdf77d3618f4df86067 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -22,7 +22,6 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
-#include "chrome/browser/download/download_extensions.h"
#include "chrome/browser/download/download_service.h"
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/download/download_target_determiner.h"
@@ -30,6 +29,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/safe_browsing/file_type_policies.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
@@ -49,6 +49,7 @@
using content::BrowserContext;
using content::BrowserThread;
using content::DownloadManager;
+using safe_browsing::FileTypePolicies;
namespace {
@@ -187,7 +188,8 @@ DownloadPrefs::DownloadPrefs(Profile* profile) : profile_(profile) {
// automatically can change in the future. When the list is tightened, it is
// expected that some entries in the users' auto open list will get dropped
// permanently as a result.
- if (download_util::IsAllowedToOpenAutomatically(filename_with_extension))
+ if (FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically(
+ filename_with_extension))
auto_open_.insert(extension);
}
}
@@ -313,7 +315,8 @@ bool DownloadPrefs::IsAutoOpenEnabledBasedOnExtension(
bool DownloadPrefs::EnableAutoOpenBasedOnExtension(
const base::FilePath& file_name) {
base::FilePath::StringType extension = file_name.Extension();
- if (!download_util::IsAllowedToOpenAutomatically(file_name))
+ if (!FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically(
+ file_name))
return false;
DCHECK(extension[0] == base::FilePath::kExtensionSeparator);
« no previous file with comments | « chrome/browser/download/download_item_model_unittest.cc ('k') | chrome/browser/download/download_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698