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 d73e3ef8bef1284e988ca8b5b64dcb4f0647eb58..c3b0aba0a494dc8f453234c3e19540643b0c3c05 100644 |
--- a/chrome/browser/download/download_shelf_context_menu.cc |
+++ b/chrome/browser/download/download_shelf_context_menu.cc |
@@ -54,14 +54,14 @@ bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const { |
case OPEN_WHEN_COMPLETE: |
return download_item_->CanShowInFolder() && |
!download_item_->IsTemporary() && |
- (!Extension::IsExtension(download_item_->GetTargetName()) || |
- extensions::switch_utils::IsOffStoreInstallEnabled()); |
+ (!download_crx_util::IsExtensionDownload(*download_item_) || |
+ download_item_->IsComplete()); |
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 |
// exclude extensions. |
return download_item_->CanOpenDownload() && |
- !Extension::IsExtension(download_item_->GetTargetName()) && |
+ !download_crx_util::IsExtensionDownload(*download_item_) && |
!download_item_->IsTemporary(); |
case CANCEL: |
return download_item_->IsPartialDownload(); |
@@ -75,7 +75,8 @@ bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const { |
bool DownloadShelfContextMenu::IsCommandIdChecked(int command_id) const { |
switch (command_id) { |
case OPEN_WHEN_COMPLETE: |
- return download_item_->GetOpenWhenComplete(); |
+ return download_item_->GetOpenWhenComplete() || |
+ download_crx_util::IsExtensionDownload(*download_item_); |
case ALWAYS_OPEN_TYPE: |
return download_item_->ShouldOpenFileBasedOnExtension(); |
case TOGGLE_PAUSE: |