Index: chrome/browser/download/download_shelf_context_menu.cc |
diff --git a/chrome/browser/download/download_shelf_context_menu.cc b/chrome/browser/download/download_shelf_context_menu.cc |
index ddc9c9d8f4364968466ae018182f766a9a287df9..d4a90d4d83ef4f79b60e8314db966440b0813984 100644 |
--- a/chrome/browser/download/download_shelf_context_menu.cc |
+++ b/chrome/browser/download/download_shelf_context_menu.cc |
@@ -8,6 +8,7 @@ |
#include "chrome/browser/download/download_crx_util.h" |
#include "chrome/browser/download/download_item_model.h" |
#include "chrome/browser/download/download_prefs.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/safe_browsing/download_protection_service.h" |
#include "chrome/browser/safe_browsing/safe_browsing_service.h" |
#include "chrome/common/extensions/extension.h" |
@@ -46,11 +47,15 @@ bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const { |
case SHOW_IN_FOLDER: |
return download_item_->CanShowInFolder() && |
!download_item_->IsTemporary(); |
- case OPEN_WHEN_COMPLETE: |
+ case OPEN_WHEN_COMPLETE: { |
+ Profile* profile = |
+ Profile::FromBrowserContext(download_item_->GetBrowserContext()); |
return download_item_->CanShowInFolder() && |
!download_item_->IsTemporary() && |
(!Extension::IsExtension(download_item_->GetTargetName()) || |
- download_crx_util::ShouldOpenExtensionDownload(*download_item_)); |
+ download_crx_util::ShouldOpenExtensionDownload( |
+ profile->GetExtensionService(), *download_item_)); |
+ } |
case ALWAYS_OPEN_TYPE: |
// For temporary downloads, the target filename might be a temporary |
// filename. Don't base an "Always open" decision based on it. Also |