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

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

Issue 10266015: Add the --disable-off-store-extension-install switch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixy fix Created 8 years, 8 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 | « chrome/browser/download/download_crx_util.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6cb748e6f6d13c327f0580641f59721c37a7cfb7..ddc9c9d8f4364968466ae018182f766a9a287df9 100644
--- a/chrome/browser/download/download_shelf_context_menu.cc
+++ b/chrome/browser/download/download_shelf_context_menu.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/download/download_shelf_context_menu.h"
#include "chrome/browser/browser_process.h"
+#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/safe_browsing/download_protection_service.h"
@@ -43,12 +44,13 @@ ui::SimpleMenuModel* DownloadShelfContextMenu::GetMenuModel() {
bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const {
switch (command_id) {
case SHOW_IN_FOLDER:
- case OPEN_WHEN_COMPLETE:
- // Don't enable "Open when complete" if the download is no longer
- // available or if it is temporary. We explicitly ignore "Open when
- // complete" for temporary downloads.
return download_item_->CanShowInFolder() &&
!download_item_->IsTemporary();
+ case OPEN_WHEN_COMPLETE:
+ return download_item_->CanShowInFolder() &&
+ !download_item_->IsTemporary() &&
+ (!Extension::IsExtension(download_item_->GetTargetName()) ||
+ download_crx_util::ShouldOpenExtensionDownload(*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
« no previous file with comments | « chrome/browser/download/download_crx_util.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698