| 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 43c85ed2a6390c998bfad5f644934000a02593ae..f426c76a63940ea22a1dcfe3e24cadaa30996e28 100644
|
| --- a/chrome/browser/download/download_shelf_context_menu.cc
|
| +++ b/chrome/browser/download/download_shelf_context_menu.cc
|
| @@ -4,12 +4,14 @@
|
|
|
| #include "chrome/browser/download/download_shelf_context_menu.h"
|
|
|
| +#include "base/command_line.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"
|
| #include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "content/public/browser/download_item.h"
|
| @@ -49,6 +51,8 @@ ui::SimpleMenuModel* DownloadShelfContextMenu::GetMenuModel() {
|
| }
|
|
|
| bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const {
|
| + static bool restart_enabled = CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableDownloadResumption);
|
| switch (static_cast<ContextMenuCommands>(command_id)) {
|
| case SHOW_IN_FOLDER:
|
| return download_item_->CanShowInFolder();
|
| @@ -64,7 +68,7 @@ bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const {
|
| case CANCEL:
|
| return download_item_->IsPartialDownload();
|
| case TOGGLE_PAUSE:
|
| - return download_item_->IsInProgress();
|
| + return restart_enabled && download_item_->CanResumeDownload();
|
| case DISCARD:
|
| case KEEP:
|
| case LEARN_MORE_SCANNING:
|
| @@ -173,8 +177,10 @@ string16 DownloadShelfContextMenu::GetLabelForCommandId(int command_id) const {
|
| case CANCEL:
|
| return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_CANCEL);
|
| case TOGGLE_PAUSE: {
|
| - if (download_item_->IsPaused())
|
| + if (download_item_->IsPaused() ||
|
| + download_item_->CanResumeInterrupted()) {
|
| return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_RESUME_ITEM);
|
| + }
|
| return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_PAUSE_ITEM);
|
| }
|
| case DISCARD:
|
|
|