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

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

Issue 16007017: [Resumption 10/12] Use DI::IsDone to check for terminal downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with r204343 Created 7 years, 6 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 34e4bbeb90739dc72ca95e9044e3bd49a3f2a2b5..ac1bd5daf265168865a86f116260f14ce77d5282 100644
--- a/chrome/browser/download/download_shelf_context_menu.cc
+++ b/chrome/browser/download/download_shelf_context_menu.cc
@@ -73,7 +73,7 @@ bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const {
return download_item_->CanOpenDownload() &&
!download_crx_util::IsExtensionDownload(*download_item_);
case CANCEL:
- return download_item_->IsPartialDownload();
+ return !download_item_->IsDone();
case TOGGLE_PAUSE:
return download_item_->GetState() == DownloadItem::IN_PROGRESS;
case DISCARD:
@@ -129,7 +129,7 @@ void DownloadShelfContextMenu::ExecuteCommand(int command_id, int event_flags) {
// It is possible for the download to complete before the user clicks the
// menu item, recheck if the download is in progress state before toggling
// pause.
- if (download_item_->IsPartialDownload()) {
+ if (download_item_->GetState() == DownloadItem::IN_PROGRESS) {
if (download_item_->IsPaused())
download_item_->Resume();
else
@@ -183,8 +183,7 @@ string16 DownloadShelfContextMenu::GetLabelForCommandId(int command_id) const {
case SHOW_IN_FOLDER:
return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_SHOW);
case OPEN_WHEN_COMPLETE:
- if (download_item_ &&
- download_item_->GetState() == DownloadItem::IN_PROGRESS)
+ if (download_item_ && !download_item_->IsDone())
return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_OPEN_WHEN_COMPLETE);
return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_OPEN);
case ALWAYS_OPEN_TYPE:
« no previous file with comments | « chrome/browser/download/download_danger_prompt_browsertest.cc ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698