summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_shelf_context_menu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/download/download_shelf_context_menu.cc')
-rw-r--r--chrome/browser/download/download_shelf_context_menu.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/chrome/browser/download/download_shelf_context_menu.cc b/chrome/browser/download/download_shelf_context_menu.cc
index 7456b82..dd220f3 100644
--- a/chrome/browser/download/download_shelf_context_menu.cc
+++ b/chrome/browser/download/download_shelf_context_menu.cc
@@ -28,21 +28,16 @@ DownloadShelfContextMenu::DownloadShelfContextMenu(
ui::SimpleMenuModel* DownloadShelfContextMenu::GetMenuModel() {
ui::SimpleMenuModel* model = NULL;
+ // We shouldn't be opening a context menu for a dangerous download, unless it
+ // is a malicious download.
+ DCHECK(!download_model_->IsDangerous() || download_model_->IsMalicious());
- if (download_item_->GetSafetyState() == DownloadItem::DANGEROUS) {
- if (download_item_->GetDangerType() ==
- content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL ||
- download_item_->GetDangerType() ==
- content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT) {
- model = GetMaliciousMenuModel();
- } else {
- NOTREACHED();
- }
- } else if (download_item_->IsComplete()) {
+ if (download_model_->IsMalicious())
+ model = GetMaliciousMenuModel();
+ else if (download_item_->IsComplete())
model = GetFinishedMenuModel();
- } else {
+ else
model = GetInProgressMenuModel();
- }
return model;
}