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

Unified Diff: chrome/browser/download/download_commands.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
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_extensions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_commands.cc
diff --git a/chrome/browser/download/download_commands.cc b/chrome/browser/download/download_commands.cc
index 0b6e1d740e63b071522074eba33334afedbff202..eeb3767e5d937730ff114c5f6d9dc622b43aebf8 100644
--- a/chrome/browser/download/download_commands.cc
+++ b/chrome/browser/download/download_commands.cc
@@ -14,7 +14,6 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_crx_util.h"
-#include "chrome/browser/download/download_extensions.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/image_decoder.h"
@@ -24,6 +23,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/common/safe_browsing/csd.pb.h"
+#include "chrome/common/safe_browsing/file_type_policies.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/google/core/browser/google_util.h"
@@ -180,8 +180,9 @@ bool DownloadCommands::IsCommandEnabled(Command command) const {
// filename. Don't base an "Always open" decision based on it. Also
// exclude extensions.
return download_item_->CanOpenDownload() &&
- download_util::IsAllowedToOpenAutomatically(
- download_item_->GetTargetFilePath()) &&
+ safe_browsing::FileTypePolicies::GetInstance()
+ ->IsAllowedToOpenAutomatically(
+ download_item_->GetTargetFilePath()) &&
!download_crx_util::IsExtensionDownload(*download_item_);
case CANCEL:
return !download_item_->IsDone();
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_extensions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698