diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-03 17:02:25 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-03 17:02:25 +0000 |
commit | 0212a81b1e35264cbe5d5ddd959b68ca99ebe381 (patch) | |
tree | 6eabf9b1f86c08aeb0f03e463737c69f01fce63a /chrome/browser/download/download_shelf.cc | |
parent | dc4760caa9d3e579a17947116b06a879c7ed7733 (diff) | |
download | chromium_src-0212a81b1e35264cbe5d5ddd959b68ca99ebe381.zip chromium_src-0212a81b1e35264cbe5d5ddd959b68ca99ebe381.tar.gz chromium_src-0212a81b1e35264cbe5d5ddd959b68ca99ebe381.tar.bz2 |
Allow cancellable download items to be removable from download shelf.
BUG=18235 (http://crbug.com/18235)
TEST=Cancel a big download and remove it.
Review URL: http://codereview.chromium.org/159769
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_shelf.cc')
-rw-r--r-- | chrome/browser/download/download_shelf.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc index 2be924f..896937b 100644 --- a/chrome/browser/download/download_shelf.cc +++ b/chrome/browser/download/download_shelf.cc @@ -73,13 +73,15 @@ bool DownloadShelfContextMenu::IsItemCommandEnabled(int id) const { case CANCEL: return download_->state() == DownloadItem::IN_PROGRESS; case REMOVE_ITEM: - return download_->state() == DownloadItem::COMPLETE; + return download_->state() == DownloadItem::COMPLETE || + download_->state() == DownloadItem::CANCELLED; default: return id > 0 && id < MENU_LAST; } } void DownloadShelfContextMenu::ExecuteItemCommand(int id) { + item_removed_ = true; switch (id) { case SHOW_IN_FOLDER: download_->manager()->ShowDownloadInShell(download_); @@ -98,6 +100,7 @@ void DownloadShelfContextMenu::ExecuteItemCommand(int id) { model_->CancelTask(); break; case REMOVE_ITEM: + item_removed_ = true; download_->Remove(false); break; default: |