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

Unified Diff: chrome/browser/ui/views/download/download_shelf_context_menu_view.cc

Issue 2439533002: Download Feedback Service should upload all eligible downloads (Closed)
Patch Set: make try bots happy Created 4 years, 1 month 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/ui/views/download/download_shelf_context_menu_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc b/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc
index 20ab817fe3626c08574537e199a3ed4906434bab..7ada929e759981804e43d9643627c0feea35ab27 100644
--- a/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc
@@ -13,9 +13,9 @@
#include "ui/views/controls/menu/menu_runner.h"
DownloadShelfContextMenuView::DownloadShelfContextMenuView(
- content::DownloadItem* download_item)
- : DownloadShelfContextMenu(download_item) {
-}
+ DownloadItemView* download_item_view)
+ : DownloadShelfContextMenu(download_item_view->download()),
+ download_item_view_(download_item_view) {}
DownloadShelfContextMenuView::~DownloadShelfContextMenuView() {}
@@ -55,3 +55,17 @@ void DownloadShelfContextMenuView::OnMenuClosed(
menu_runner_.reset();
}
+
+void DownloadShelfContextMenuView::ExecuteCommand(int command_id,
+ int event_flags) {
+ DownloadCommands::Command command =
+ static_cast<DownloadCommands::Command>(command_id);
+ DCHECK_NE(command, DownloadCommands::DISCARD);
+
+ if (command == DownloadCommands::KEEP) {
+ download_item_view_->MaybeSubmitDownloadToFeedbackService(
+ DownloadCommands::KEEP);
+ } else {
+ DownloadShelfContextMenu::ExecuteCommand(command_id, event_flags);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698