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

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

Issue 852043002: Initial Implementation of Download Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 11 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 0c87b3d88cb56d55f3587fbaddde801f243adeff..660dc7adf9e21dd42e023078823db41e12a89a72 100644
--- a/chrome/browser/download/download_shelf_context_menu.cc
+++ b/chrome/browser/download/download_shelf_context_menu.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/download/download_commands.h"
#include "chrome/browser/download/download_crx_util.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_prefs.h"
@@ -86,7 +87,7 @@ bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const {
if (!download_item_)
return false;
- switch (static_cast<ContextMenuCommands>(command_id)) {
+ switch (static_cast<DownloadCommands>(command_id)) {
case SHOW_IN_FOLDER:
return download_item_->CanShowInFolder();
case OPEN_WHEN_COMPLETE:
@@ -108,6 +109,8 @@ bool DownloadShelfContextMenu::IsCommandIdEnabled(int command_id) const {
case LEARN_MORE_SCANNING:
case LEARN_MORE_INTERRUPTED:
return true;
+ default:
+ break;
}
NOTREACHED();
return false;
@@ -117,7 +120,7 @@ bool DownloadShelfContextMenu::IsCommandIdChecked(int command_id) const {
if (!download_item_)
return false;
- switch (command_id) {
+ switch (static_cast<DownloadCommands>(command_id)) {
case OPEN_WHEN_COMPLETE:
return download_item_->GetOpenWhenComplete() ||
download_crx_util::IsExtensionDownload(*download_item_);
@@ -133,6 +136,8 @@ bool DownloadShelfContextMenu::IsCommandIdChecked(int command_id) const {
return download_item_->ShouldOpenFileBasedOnExtension();
case TOGGLE_PAUSE:
return download_item_->IsPaused();
+ default:
+ break;
}
return false;
}
@@ -151,7 +156,7 @@ void DownloadShelfContextMenu::ExecuteCommand(int command_id, int event_flags) {
if (!download_item_)
return;
- switch (static_cast<ContextMenuCommands>(command_id)) {
+ switch (static_cast<DownloadCommands>(command_id)) {
case SHOW_IN_FOLDER:
download_item_->ShowDownloadInShell();
break;
@@ -222,6 +227,8 @@ void DownloadShelfContextMenu::ExecuteCommand(int command_id, int event_flags) {
ui::PAGE_TRANSITION_LINK,
false));
break;
+ default:
+ break;
}
}
@@ -236,7 +243,7 @@ bool DownloadShelfContextMenu::IsItemForCommandIdDynamic(int command_id) const {
base::string16 DownloadShelfContextMenu::GetLabelForCommandId(
int command_id) const {
- switch (static_cast<ContextMenuCommands>(command_id)) {
+ switch (static_cast<DownloadCommands>(command_id)) {
case SHOW_IN_FOLDER:
return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_SHOW);
case OPEN_WHEN_COMPLETE:
@@ -264,6 +271,8 @@ base::string16 DownloadShelfContextMenu::GetLabelForCommandId(
case LEARN_MORE_INTERRUPTED:
return l10n_util::GetStringUTF16(
IDS_DOWNLOAD_MENU_LEARN_MORE_INTERRUPTED);
+ default:
+ break;
}
NOTREACHED();
return base::string16();

Powered by Google App Engine
This is Rietveld 408576698