| Index: chrome/browser/download/download_util.cc
|
| diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
|
| index a0d774a34bd0529aa704db187997981d0a6f0026..784bdbc7a0323d277936c6ed6b5de1ef2ef58a0c 100644
|
| --- a/chrome/browser/download/download_util.cc
|
| +++ b/chrome/browser/download/download_util.cc
|
| @@ -738,18 +738,22 @@ FilePath GetCrDownloadPath(const FilePath& suggested_path) {
|
|
|
| // TODO(erikkay,phajdan.jr): This is apparently not being exercised in tests.
|
| bool IsDangerous(DownloadCreateInfo* info, Profile* profile) {
|
| - // Downloads can be marked as dangerous for two reasons:
|
| - // a) They have a dangerous-looking filename
|
| - // b) They are an extension that is not from the gallery
|
| - if (IsExecutableFile(info->suggested_path.BaseName())) {
|
| + DownloadDangerLevel danger_level = GetFileDangerLevel(
|
| + info->suggested_path.BaseName());
|
| +
|
| + if (danger_level == Dangerous) {
|
| + return true;
|
| + } else if (danger_level == AllowOnUserGesture && !info->has_user_gesture) {
|
| return true;
|
| } else if (info->is_extension_install) {
|
| ExtensionsService* service = profile->GetExtensionsService();
|
| if (!service ||
|
| !service->IsDownloadFromGallery(info->url, info->referrer_url)) {
|
| + // Extensions that are not from the gallery are considered dangerous.
|
| return true;
|
| }
|
| }
|
| +
|
| return false;
|
| }
|
|
|
|
|