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

Unified Diff: chrome/browser/download/download_shelf_context_menu.cc

Issue 10452009: Improve the UI for disabling off-store extension install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments, fixed tests Created 8 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
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:

Powered by Google App Engine
This is Rietveld 408576698