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

Unified Diff: chrome/browser/file_select_helper.cc

Issue 1613483003: [SafeBrowsing] Alternate extensions should also be subject to block list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment in histograms.xml Created 4 years, 11 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 | « no previous file | chrome/browser/safe_browsing/unverified_download_field_trial.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/file_select_helper.cc
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index ff1b94356d6031225ddd499ef98777c15a6d9ccf..3be51789d2914ff5cf62b028f25b2fbd7c390702 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -457,13 +457,21 @@ void FileSelectHelper::GetSanitizedFilenameOnUIThread(
GetSanitizedFileName(params->default_file_name));
#if defined(FULL_SAFE_BROWSING)
+ std::vector<base::FilePath::StringType> alternate_extensions;
+ if (select_file_types_) {
+ for (const auto& extensions : select_file_types_->extensions) {
+ alternate_extensions.insert(alternate_extensions.end(),
+ extensions.begin(), extensions.end());
+ }
+ }
+
// Note that FileChooserParams::requestor is not considered a trusted field
// since it's provided by the renderer and not validated browserside.
if (params->mode == FileChooserParams::Save &&
- !params->default_file_name.empty()) {
+ (!params->default_file_name.empty() || !alternate_extensions.empty())) {
GURL requestor = params->requestor;
safe_browsing::CheckUnverifiedDownloadPolicy(
- requestor, default_file_path,
+ requestor, default_file_path, alternate_extensions,
base::Bind(&FileSelectHelper::ApplyUnverifiedDownloadPolicy, this,
default_file_path, base::Passed(&params)));
return;
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/unverified_download_field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698